Using the WebSphere DataPower Option for Application Optimization to demonstrate self-balancing across multiple DataPower appliances and intelligent load distribution to backend servers

In this tutorial, you will learn two key features of WebSphere® DataPower Option for Application Optimization: self-balancing and intelligent load distribution. The tutorial shows how to use the self-balancing feature to distribute loads across multiple DataPower appliances without the complexity of an external load balancer. It also demonstrates the intelligent distribution of workloads to backend WebSphere Application Server instances.

Sudhir Mohith (smohith@us.ibm.com), Advisory Software Engineer, IBM

Photo of Sudhir MohithSudhir Mohith is an Advisory Software Engineer from the WW WebSphere Business Partner – Technical Professionals organization. He has over 15 years of experience in the IT industry, has a number of publications under his belt, and has presented at multiple technical conferences. He joined IBM from Transarc in 2000 as a Technical Support Engineer and Developer for DCE/DFS and Encina. For the past 5 years, Sudhir has been specializing in WebSphere DataPower appliances and cloud computing. He holds a BS (Hons) degree in Computer Science from the Australian National University, and an MPhil in Computer Vision from the University of Manchester Institute of Science and Technology.



11 July 2012

Also available in Chinese Portuguese

Before you start

The IBM WebSphere DataPower Option for Application Optimization (AO) is designed to provide dynamic load balancing functions for the most demanding cases. By evenly distributing a load across WebSphere DataPower appliances and then intelligently route traffic to selected backend servers based on application availability, AO can improve uptime, user response time, and application server utilization.

The key benefits of AO include:

  • Distributing load across multiple appliances without the need for an external load balancer.
  • Intelligently load balancing to backend servers based on metadata from application servers.
  • Integrating with IBM z/OS® Communications Server Sysplex Distributor, which can balance workload to DataPower appliances.
  • Supporting interruption-free backend application upgrades through support for application edition management. You can rollout new editions of an application using either group or automatic updates.

AO is a licensed software feature that comes standard on the WebSphere DataPower Edge Appliance XE82 and is available both at initial ordering time and as a field upgradable option on WebSphere DataPower Integration Appliance XI52, WebSphere DataPower Service Gateway XG45 appliance, WebSphere DataPower Integration Blade XI50B, and WebSphere DataPower Integration Appliance for zEnterprise XI50z. When choosing the upgradable option, once your order is fulfilled, you will receive an Authorized Feature Download letter along with a Controlled Access Key to download the AO upgrade firmware update.

Objectives

In this tutorial, you will learn how to set up and demonstrate the self-balancing (SB) and intelligent load distribution (ILD) features of the Application Optimization (AO) licensed option for WebSphere DataPower.

The first part of the tutorial provides step-by-step instructions on how to configure and test services to benefit from the frontend SB functionality of WebSphere DataPower as a substitute for network load balancers.

The second part of the tutorial concentrates on the ILD component of the AO option. Instructions are provided on how to configure load balancer objects to dynamically distribute the load among a cluster of WebSphere Application Server (hereafter called Application Server) members.

Prerequisites

Familiarity with the IBM WebSphere DataPower family of products from an administrative standpoint is helpful. Some experience with configuring and deploying services on the appliance is also beneficial. Furthermore, knowledge of IBM WebSphere Application Server, including Network Deployment (ND) terminology and clustering and the ability to deploy and monitor web applications, is important to fully understand the AO capability.

System requirements

You will need privileged user access to two WebSphere DataPower appliances from the XI52, XG45, XI50B/z, or XE82 family, at firmware level 3.8.1 or higher (4.0.2+ on the XG45 and 1.0.0+ on the XE82). Each appliance needs to be licensed with the AO option. In addition, you will need system administrative access to a WebSphere Application Server Network Deployment (ND) cell, at Version 6.1 or higher, with a Deployment Manager and a federated node. You may also use WebSphere Application Server Virtual Enterprise instead.

You will also need to download a couple of open source tools to invoke some tests from a client workstation, namely:

  • cURL is a command line tool for sending and receiving files using the URL syntax over a wide range of Internet protocols.
  • The ApacheBench (ab) tool comes bundled with the standard Apache source distribution.

Duration

Plan to allocate at least four (4) hours to complete the tutorial. Additional time may be needed if you are not familiar with certain tasks or additional requirements, such as network configuration parameters or product binaries that are not readily available.


Part 1. Configure the appliances for self-balancing

In order for the DataPower appliances to participate in frontend self-balancing, they need to be licensed. To verify AO licensing, complete the following steps, once for each appliance:

  1. Login to the WebSphere DataPower WebGUI as a privileged user and navigate to Status > System > Device Features. You can also get to this menu item by simply typing device features in the Search box.
  2. Verify that the Option for Application Optimization support is enabled and available, as shown in Figure 1.
    Figure 1. Device features
    Device features

    For each appliance, you need to pick a network interface to be set up for self-balancing. It is common practice to pick the same interface name, such as eth11, on each appliance.

  3. Starting with the first appliance, browse through Network > Interface > Ethernet Interface and select an active network interface you would like to enable for self-balancing.
  4. Switch to the Standby Control tab and click Add.
    1. Specify a unique Group Number that is not currently in use within your network and with a value higher than 20 to prevent conflict with network routers and switches. This information is generally available from your network administrator and has to be the same on both appliances.
    2. The Virtual IP Address (VIP) you supply acts as an abstract virtual IP to service traffic to all devices within the standby group. Note that the VIP must exist on the same subnet as the appliance's real IP address and needs to be the same for both appliances.
    3. The Priority field decides which appliance will assume the role of controller or distributor for the cluster. The one with the highest priority becomes the primary, and the one with lower ranking is elected in case of a failure of the primary. Therefore, leave that field at the default value of 100 for the appliance you pick to be primary and set it to 90 for the other.
    4. Set the Enable/Disable Self-Balancing flag to on and click Apply, as shown in Figure 2.
      Figure 2. Standby control
      Standby control
    5. Repeat Steps 3 and 4 above for the second appliance.

    If you set the Log Level to "debug" in the default domain of the appliances, you see messages showing the self-balancing function in action. The example in Figure 3 shows the secondary appliance doing health checks on the primary appliance every two seconds to verify that it is still up.

    Figure 3. Self-balancing debug logs
    Self-balancing debug logs

Deploy a service to demonstrate self-balancing

To demonstrate the self-balancing operation on the DataPower appliances, you configure an XML Firewall service on each appliance to listen to incoming requests on the Virtual IP address defined previously and on a port that you specify. The primary distributor or controller takes care of load balancing the requests across the appliances in a way similar to an IP sprayer.

On each appliance, complete the following steps:

  1. Log in as a privileged user in the default domain and navigate through Administration > Configuration > Application Domain to create an application domain called "AO" in which you will configure the service.
  2. Switch to the AO domain and browse through Control Panel > XML Firewall and click Add Wizard.
  3. Select Pass Thru (testing only) and click Next.
  4. For the Firewall Name, enter SB_XMLFW.
  5. Select loopback-proxy for the Firewall Type.
  6. Type in the Virtual IP address you defined previously in the Device Address field, and use an unassigned port in the Device Port field. Use the same VIP and port values on each appliance.

    Tip: You can refer to Status > IP-Network > TCP Port Status to find an unused port on the appliance.

  7. Commit the changes you made and click Done.
  8. Click on the SB_XMLFW XML Firewall service and change the Request Type to XML and click Apply (see Figure 4).

    Note that you can also create the XML Firewall service on the primary appliance and export the configuration to the second appliance.

    Figure 4. Self-balancing XML Firewall
    Self-balancing XML Firewall
  9. Set the Log Level to "debug" in the AO domain to see the incoming messages in the logs. Click Save Config to save your configuration.

    Switch to the client workstation where you downloaded and installed the software tools earlier.

  10. Run the following ApacheBench command "ab" with 10 concurrent POST requests, substituting the string 172.20.0.59:4000 with the VIP and port you defined for your XML Firewall (see Figure 5). The referenced xycohr.html file is available from the Download section of this tutorial.
    ab –n 10 –c 10 –p xycohr.html http://172.20.0.59:4000/
    Figure 5. ApacheBench tool
    ApacheBench tool
  11. Check the system logs for the XML Firewall service on each appliance. You see an even distribution of five transactions on each. You may want to filter the logs by "multistep" to only display the relevant information, as shown in Figure 6
    Figure 6. XML Firewall logs
    XML Firewall logs
  12. Back to the default domain of the primary appliance, browse through Network > Interface > Ethernet Interface to disable the Ethernet interface in the standby control group, simulating a failure of that appliance. If you still have debug logging turned on in the default domain, notice the secondary appliance detecting the primary being down and automatically promoting itself as distributor or controller, as shown in Figure 7.
    Figure 7. Self-balancing failover debug logs
    Self-balancing failover debug logs
  13. Re-run the ApacheBench command from the client workstation. Notice that all ten transactions are being received by the secondary appliance, as shown in Figure 8.
    Figure 8. XML Firewall failover logs
    XML Firewall failover logs
  14. Re-enable the Ethernet interface of the primary appliance in the standby control group and verify from the default domain debug logs that it re-assumes the role of distributor or controller. Also, if interested, re-run the ApacheBench command to verify the even spread of five transactions on each appliance.

Part 2. Configure the intelligent load distribution

To demonstrate the intelligent load distribution (ILD) feature of the AO Option, you need a WebSphere Application Server ND cell with the DefaultApplication deployed within a cluster and with two active members.

If you configured your WebSphere cell to have a Deployment Manager and a federated node, the DefaultApplication should already be deployed to the standalone server, server1. Make sure the Deployment Manager and Node Agent are started from their respective profile bin directories.

To promote that application to a new cluster member, complete the following steps:

  1. Login to the Application Server admin console.
  2. Expand Servers > Clusters > WebSphere application server clusters and click New.
  3. Specify WASCluster for the Cluster name and click Next.
  4. For the Member name, enter server1 and choose the option to Create the member using an existing application server as template and select the server1 entry.
  5. Create one additional member and call it server2 and add it to the cluster. Click Next.
  6. Click Finish and Save your configuration.
  7. Start the WASCluster.
  8. Verify that you can access the "snoop" servlet of the DefaultApplication via each cluster member. You may need to query the WC_defaulthost port for each cluster member first and substitute that with the port value shown below. Similarly, you need to substitute the IP address with that of your Node Agent.
    http://172.20.1.51:9080/snoop
    http://172.20.1.51:9081/snoop

    Now that you have defined your Application Server cluster with the DefaultApplication deployed to it, you need to install the WebSphere OnDemand Configuration (ODCInfo) application to the Deployment Manager of your WebSphere cell. The ODCInfo application provides intelligent load distribution through the retrieval of workload management information from the cell. The ODCInfo package is part of the ResourceKit that you can download from the same IBM Fix Central location as the WebSphere DataPower firmware updates.

    Once downloaded and extracted, follow the step-by-step instructions in the WebSphere DataPower Information Center to install and start the ODCInfo application. Search for "Enabling the retrieval of workload management information" to get to the right source.

    Tip: Choose the newest version of the supplied WAR file, even if it does not exactly match the Application Server version installed on your system.

    If you have not done so yet, within the Application Server admin console, follow the Environment > Virtual hosts > default_host > Host Aliases trail to create an entry in the virtual host alias table for port 9060 for all (*) host names, as shown in Figure 9.

    Figure 9. Virtual host alias
    Virtual host alias
  9. Verify that you can retrieve the Application Server cluster information via the ODCInfo application by substituting 172.20.1.51 with the IP address of your Deployment Manager system and WASCluster with the name of the cluster you have defined.
    http://172.20.1.51:9060/ODCInfo/ODCInfo?c=WASCluster

    If all is well, you see something similar to what is shown in Figure 10.

    Figure 10. ODCInfo cell status
    ODCInfo cell status

    If not, you may have to restart your WebSphere cell after the ODCInfo application was installed.

Deploy a service to demonstrate intelligent load distribution

For the purpose of this tutorial, only one DataPower appliance is used to demonstrate the ILD feature of the Option for AO. However, in a real world scenario, you want to use more than one to prevent a single point of failure.

  1. Log back in to the WebSphere DataPower WebGUI as a privileged user. Within the AO domain, and navigate to Objects > Network Settings > Load Balancer Group. Click Add.
  2. For the Name, enter WASLoadBalancer.
  3. Toggle the radio button for Retrieve Workload Management Information to "on".
  4. Click on the plus (+) button next to the WebSphere Cell field to create a new cell definition object.
  5. Within the Configure WebSphere Cell window, enter the following information, substituting 172.20.1.51 with the IP address of your Deployment Manager host and 9060 with the port on which it is listening:
    1. Name: WASCell
    2. Deployment Manager Host: 172.20.1.51
    3. Deployment Manager Port number: 9060
  6. For the Workload Management Group Name, enter WASCluster.
  7. Back to the main window, click Apply and then Save Config.

    Your new load balancer group object configuration looks similar to the configuration shown in Figure 11.

    Figure 11. Load balancer group
    Load balancer group

    Note: In the above example, we are using a simple Round Robin algorithm to load balance our requests. In reality, use a Weighted Round Robin or Weighted Least Connection algorithm since the backend servers may not be similar in hardware resources. This is even of more importance for a Virtual Enterprise environment, where the weights change dynamically on demand.

  8. Browse through Status > IP Network > Load Balancer Status and verify that the DataPower appliance can successfully query the ODCInfo application to return the cluster member information (Figure 12).
    Figure 12. Load balancer status
    Load balancer status

    Notice how the ODCInfo application is returning the short hostname (fully qualified domain name, FQDN, in the case of WebSphere Virtual Enterprise), Windows-XP-Prof. In order for the WebSphere DataPower appliance to resolve that hostname, it needs to either be listed in DNS or statically defined on the appliance.

  9. Switch to the default domain and expand Network > Interface > DNS Settings. Click on the Static Hosts tab and add a host or IP mapping entry for Windows-XP-Prof.
  10. Click Save Config to save your configuration.

    You can use the TCP Connection Test from the Troubleshooting Panel to verify that the DNS static host is resolving correctly, as shown in Figure 13.

    Figure 13. TCP connection test
    TCP connection test
  11. Switch to the AO domain and browse through Control Panel > XML Firewall and click Add Wizard.
  12. Select Pass Thru (testing only) and click Next.
  13. For the Firewall Name, enter ILD_XMLFW.
  14. Select the default static-backend for the Firewall Type.
  15. Enter WASLoadBalancer for the Server Address and 9080 in the Server Port field. Click Next.
  16. For the frontside handler, leave the default 0.0.0.0 value for the Device Address and enter an unassigned port in the Device Port field. Click Next.
  17. Commit the changes you made and click Done.
  18. Click on the ILD_XMLFW XML Firewall service followed by the Advanced tab.
  19. Set the Disallow GET (and HEAD) field to "off" and the Process Messages Whose Body is Empty to "on".
  20. Go back to the General tab.
  21. Click on the plus (+) button next to the XML Manager field.
  22. For the Name, enter WAS_ILD_XMLMgr.
  23. From the Load Balancer Groups drop down, select WASLoadBalancer and press Add.
  24. Click Apply to return to the XML Firewall main page and click Apply once more to apply all the changes. Click Save Config to save your configuration (see Figure 14).
    Figure 14. Intelligent load distribution XML Firewall
    Intelligent load distribution XML Firewall

    You are now ready to send a few requests to your ILD_XMLFW XML Firewall service to have it intelligently handle the load distribution to the cluster of application server members on the backend system.

    Switch to the client workstation where you downloaded and installed the software tools earlier.

  25. From a command window, run the "cURL" utility a number of times, substituting 172.20.0.60 with your primary DataPower appliance's IP address, and 4010 with the frontside handler port that you defined for the ILD_XMLFW service (see Figure 15):
    curl http://172.20.0.60:4010/snoop
    Figure 15. cURL tool
    cURL tool

    Each time you invoke the cURL utility, you see the port alternate between 9080 and 9081 (or whichever ports the Application Server cluster members are listening on). This shows that the load is being distributed across the two cluster members.

    Now, if a new server is added to the cluster, the ODCInfo application pulls the updated data about the application servers in the cell. The WebSphere cell configuration on the DataPower appliance, in turn, retrieves that information from ODCInfo and updates the data in the load balancer group. The latter then uses this data to adapt to changing traffic conditions and application server capabilities to optimally distribute traffic among the application servers in the cell.

  26. Switch to the Application Server admin console and add a new member to the WASCluster and start it, as shown in Figure 16.
    Figure 16. Add new cluster member
    Add new cluster member
  27. Back on the DataPower WebGUI, browse through Status > IP Network > Load Balancer Status and verify that the cluster member information has been updated to include the new member, as shown in Figure 17.
    Figure 17. New load balancer status
    New load balancer status

    Now, when you invoke the cURL utility against the ILD_XMLFW XML Firewall service on the primary DataPower appliance, you see the load being distributed evenly across all three cluster members, for example, between ports 9080, 9081, and 9082, as shown in Figure 18.

    Figure 18. New cURL tool
    New cURL tool

As an exercise, you can change the weights of the different Application Server cluster members. For example, you can assign a weight of 2 to server1, and a weight of 1 to server2 and server3 so that server1 receives twice as many requests as server2 or server3. You can then change the algorithm of the WASLoadBalancer load balancer group to use "Weighted Round Robin" or "Weighted Least Connections" in order to experiment with and verify that you are getting the expected results.


Conclusion

This tutorial introduced the two core components of the Option for Application Optimization, namely self-balancing and intelligent load distribution. You learned how to use the self-balancing feature to distribute loads across multiple DataPower appliances without the extra hoops and complexity of an external load balancer. At the same time, you used the intelligent load distribution feature to intelligently and dynamically load balance traffic to backend servers, based on feedback from the application servers.


Download

DescriptionNameSize
Code sampledownload.zip1KB

Resources

Learn

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=824771
ArticleTitle=Using the WebSphere DataPower Option for Application Optimization to demonstrate self-balancing across multiple DataPower appliances and intelligent load distribution to backend servers
publish-date=07112012