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:
- Login to the Application Server admin console.
- Expand Servers > Clusters > WebSphere application server clusters and click New.
WASClusterfor the Cluster name and click Next.
- For the Member name, enter
server1and choose the option to Create the member using an existing application server as template and select the
- Create one additional member and call it
server2and add it to the cluster. Click Next.
- Click Finish and Save your configuration.
- Start the WASCluster.
- 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
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
- Verify that you can retrieve the Application Server cluster
information via the ODCInfo application by substituting
172.20.1.51with the IP address of your Deployment Manager system and WASCluster with the name of the cluster you have defined.
If all is well, you see something similar to what is shown in Figure 10.
Figure 10. ODCInfo cell status
If not, you may have to restart your WebSphere cell after the ODCInfo application was installed.
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.
- 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.
- For the Name, enter
- Toggle the radio button for Retrieve Workload Management Information to "on".
- Click on the plus (+) button next to the WebSphere Cell field to create a new cell definition object.
- Within the Configure WebSphere Cell window, enter
the following information, substituting
172.20.1.51with the IP address of your Deployment Manager host and
9060with the port on which it is listening:
- Deployment Manager Host:
- Deployment Manager Port number:
- For the Workload Management Group Name, enter
- Back to the main window, click Apply and then
Your new load balancer group object configuration looks similar to the configuration shown in Figure 11.
Figure 11. 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.
- 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
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.
- 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.
- Click Save Config to save your
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
- Switch to the AO domain and browse through Control Panel > XML Firewall and click Add Wizard.
- Select Pass Thru (testing only) and click Next.
- For the Firewall Name, enter
- Select the default static-backend for the Firewall Type.
WASLoadBalancerfor the Server Address and
9080in the Server Port field. Click Next.
- For the frontside handler, leave the default
0.0.0.0value for the Device Address and enter an unassigned port in the Device Port field. Click Next.
- Commit the changes you made and click Done.
- Click on the ILD_XMLFW XML Firewall service followed by the Advanced tab.
- Set the Disallow GET (and HEAD) field to "off" and the Process Messages Whose Body is Empty to "on".
- Go back to the General tab.
- Click on the plus (+) button next to the XML Manager field.
- For the Name, enter
- From the Load Balancer Groups drop down, select WASLoadBalancer and press Add.
- 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
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.
- From a command window, run the "cURL" utility a number of times,
172.20.0.60with your primary DataPower appliance's IP address, and
4010with the frontside handler port that you defined for the ILD_XMLFW service (see Figure 15):
Figure 15. 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.
- 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
- 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
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
9082, as shown in Figure 18.
Figure 18. 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.