Go to new doc!

+49 228 5552576-0


info@predic8.com

Tutorial: Web Services Loadbalancing in the Amazon Cloud Using Membrane

In this tutorial we will first deploy copies of the same Web service on different instances within the Amazon cloud. We then register another instance with the Membrane Router to act as a loadbalancer. For simplicity we will use pre-configured AMIS images for the instances. The routing will be configured using Membrane's Web Console. Finally we will test the Web services with soapUI.

Starting the Web Service Nodes

  1. Login to the AWS console

    https://console.aws.amazon.com/ec2/

  2. Create an EC2 instance. Use the AMIS image with the following id:

    ami-6552940c

    The Membrane LB Node AMIS Image

    Figure1: The Membrane LB Node AMIS Image

  3. Use an instance type of your choice with default disk settings.

  4. Set the tag name to Membrane LB Node 1

  5. Membrane LB Node Name Tag

    Figure2: Membrane LB Node Name Tag

  6. Use a security group that has the port 8080 open.

  7. After you have started the instance, check if the Web service is running, and open the following URL:

    http://AMIS_PUBLIC_DNS_NAME:8080/prims?wsdl

    Substitute the host name with the public DNS name of the instance.

  8. Finally create two additional instances like the one above. Use appropriate tag names like Membrane LB Node 2-3.

Starting the Loadbalancer

  1. Create a EC2 instance. Use the AMIS image with the following id:

    ami-f969af90

  2. Use an instance type of your choice with default disk settings.

  3. Set the tag name to Membrane LB

  4. Membrane LB Name Tag

    Figure3: Membrane LB Name Tag

  5. Use a security group that has the ports 80, 9000 and 9010 open.

  6. After you have started the instance, open the Web console at the following URL:

    http://AMIS_PUBLIC_DNS_NAME:9000/admin

    Substitute the host name with the public DNS name of the instance.

  7. Login with username admin and password membrane

    Web Console

    Figure4: Web Console

Configuring the Default Cluster

  1. On the Web console click on the tab Loadbalancer and then on the link Default.

    Web Console Clusters

    Figure5: Web Console Clusters

  2. Create a new node. Use the private DNS name of a node instance as host with port 8080.

    Default Cluster

    Figure6: Default Cluster

  3. Create two additional nodes for the remaining two node instances.

    Default Cluster with 3 Nodes

    Figure7: Default Cluster with 3 Nodes

Testing with soapUI

  1. Open soapUI and create a new project with the following WSDL:

    http://AMIS_PUBLIC_DNS_NAME/prims?wsdl

    Use the public DNS name of the instance (E.g Membrane LB) where the membrane router is running.

    SoapUI Project for the Prim Service

    Figure8: SoapUI Project for the Prim Service

  2. Create a request like the following:

    					<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    					  				     xmlns:ns="http://membrane-soa.org/lb/1/">
    					   <soapenv:Header/>
    					   <soapenv:Body>
    						  <ns:countPrims>
    							 <n>100000</n>
    						  </ns:countPrims>
    					   </soapenv:Body>
    					</soapenv:Envelope>
    				
    Listing 1: Example Request for the Prim Service
  3. Run a load test.

  4. Take a look at the call statistics of each node using the Web console.

    Cluster Statistics

    Figure9: Cluster Statistics

Congratulations, you have set up a Web Services cluster in the Amazon Cloud!

Next Steps

You can find a list of all configuration features here.