Load balancing with WebSphere

<< Click to Display Table of Contents >>

Navigation:  Bizagi Engine > Bizagi system administration > Bizagi server configuration > Bizagi Engine JEE platform configuration > Setting up the system architecture > Configuring a load balancer >

Load balancing with WebSphere

applies_JEE

 

The following section illustrates an example where a load balancer is configured for the Bizagi server.

This example applies for the JEE edition in which we will use a clustered WebSphere configuration through the load balance modules in Apache HTTP Server.

Therefore and before you move on, make sure you have already set up your WebSphere cluster, as described at Clustered WebSphere configuration.

 

Keep in mind that Bizagi supports hardware or software load balancers, and it is recommended the use of a hardware-based load balancer (e.g, F5).

For more information about the general overview, refer to Configuring a load balancer.

 

 

Example

To illustrate how to configure load balancing, in this section we will describe which changes are required when using Apache HTTP Server (and its load balancing modules).

Therefore, in this example we part from having Apache HTTP Server installed in a Web server.

 

You may download this server directly from Apache HTTP Server's official webpage, and choose the version according to your platform and operating system.

The path in which Apache HTTP Server is installed, will be referred to as <APACHE_HOME> from this point on.

 

SettingBizagiInternet00_InstallingApache

 

 

Configure the load balancer to consider multiple nodes.

In our example using Apache HTTP Server and WebSphere, we specify which nodes make up the clustered configuration by editing Apache's configuration file <APACHE_HOME>\conf\httpd.conf

 

To do this, ensure you enable the necessary modules as described below.

 

Review that these lines are not commented so that the modules are found active:

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule headers_module modules/mod_headers.so

LoadModule deflate_module modules/mod_deflate.so

 

Include the deflate module configuration to rely on HTTP compression features for enhancements in traffic and performance (especially for mobile device access):

# Method 1: Only compress specified content type

<Location />

<IfModule mod_deflate.c>

# compress content with type html, text, and css

AddOutputFilterByType DEFLATE text/html text/plain text/css text/javascript text/json application/javascript text/xml

<IfModule mod_headers.c>

# properly handle requests coming from behind proxies

Header append Vary User-Agent

</IfModule>

</IfModule>

</Location>

# deflate.log, log compression ratio on each request

#<IfModule mod_deflate.c>

# DeflateFilterNote Input instream

# DeflateFilterNote Output outstream

# DeflateFilterNote Ratio ratio

# LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate

# CustomLog logs/deflate.log deflate

#</IfModule>

# Properly handle old browsers that do not support compression

<IfModule mod_deflate.c>

BrowserMatch ^Mozilla/4 gzip-only-text/html

BrowserMatch ^Mozilla/4\.0[678] no-gzip

BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

</IfModule>

 

Add these new lines into the <VirtualHost> definition, as shown below:

<VirtualHost *:80>

 ProxyRequests OFF

 ServerName [Balancer_Server]:80

 Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

 <Proxy balancer://[Cluster_Name]>

   BalancerMember http://[Node1_Name]:[Port1] route=1

   BalancerMember http://[Node2_Name]:[Port2] route=2

   Order Deny,Allow

   Deny from none

   Allow from all

   ProxySet lbmethod=byrequests

   ProxySet stickysession=ROUTEID

 </Proxy>

 <Location /balancer-manager>

   SetHandler balancer-manager

   Order deny,allow

   Allow from localhost

 </Location>

 ProxyPass /balancer-manager !

 ProxyPass /BizAgi-war/ balancer://[Cluster_Name]/BizAgi-war/

 ProxyPassReverse /BizAgi-war/ http://[Node1_Name]:[Port1] route=1

 ProxyPassReverse /BizAgi-war/ http://[Node2_Name]:[Port2] route=2

</VirtualHost>

 

Consider:

[Balancer_Server]: Name (or IP address) of the Server which carries out the load balancing (in this example, it is the localhost set with Apache).

[Cluster_Name]: Name (or IP address) of the Server which represents the cluster.

[Node1_Name]: Name (or IP address) of the Server where the first node making up the cluster is found.

[Port1]: Port number under which the first node attends requests.

[Node2_Name]: Name (or IP address) of the Server where the second node making up the cluster is found.

[Port2]: Port number under which the second node attends requests.

Note that the use of this line: BalancerMember http://[NodeN_Name]:[PortN] route=N should be added for each node member of the cluster.

The same applies for this line as well: ProxyPassReverse /BizAgi-war/ http://[NodeN_Name]:[PortN] route=N.

 

In the following example we can see that load balancing is set for 2 servers: MyServer01 and MyServer02 (under ports number: 9082 and 9083).

The complete VirtualHost definition for Apache is:

 

<VirtualHost *:80>

 ProxyRequests OFF

 ServerName MyApacheServer:80

 Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

 <Proxy balancer://WASCluster>

   BalancerMember http://MyServer01:9082 route=1

   BalancerMember http://MyServer02:9083 route=2

   Order Deny,Allow

   Deny from none

   Allow from all

   ProxySet lbmethod=byrequests

   ProxySet stickysession=ROUTEID

 </Proxy>

 <Location /balancer-manager>

   SetHandler balancer-manager

   Order deny,allow

   Allow from localhost

 </Location>

 ProxyPass /balancer-manager !

 ProxyPass /BizAgi-war/ balancer://WASCluster/BizAgi-war/

 ProxyPassReverse /BizAgi-war/ http://MyServer01:9082/BizAgi-war/

 ProxyPassReverse /BizAgi-war/ http://MyServer02:9083/BizAgi-war/

</VirtualHost>

 

 

note_pin

Bizagi supports any load balancing algorithm, and the only requirement for the load balancer configuration is that sticky sessions are enabled. We can see its use in this line:

ProxySet stickysession=ROUTEID

 

Once you have finished editing this file, save the changes and close it.

 

Verifying the configuration

To verify that  the load balancer provided by Apache is operational and that the nodes of the cluster are ready to attend to requests, enter the following URL in a browser of your choice:

http://[Balancer_Server]/balancer-manager

 

In this option, you will be able to see a list of the nodes and their current status:

 

 

LoadBalance_WebSphere03

 

Configure the JEE Application Server to support load balancing

Ensure that your JEE Application Server supports load balancing capabilities.

This may imply you will have to install certain plugins depending on the given Application Server and its version.

 

In this example, using WebSphere and Apache HTTP Server, will require the following actions:

 

Acess to the administration console and then go into the Servers section.

Expand the Server types item and click on Web servers.

 

Click the New button to register para registrar a Web server from which requests will be balanced.

 

LoadBalance_WebSphere01

 

Enter the following information:

oSelect node: Select the first node of your cluster.

oServer name: Type a unique name to identify this server.

Enter ApacheLoadBalancer.

oType: Select Apache HTTP Server from the drop-down list.

 

Click on Next.

 

When selecting the templates, you may leave the defaults and click Next.

In the next window, define locations considering:

oPort :  Enter the port number under which the Web server attends requests.

In the Apache HTTP Server example, this port is set as 80.

oPlug-in installation location:  Enter the local path in which WebSphere will install its plugin (this path should not contain spaces).

You may leave the default path.

oApplication mapping to the Web server : Select All from the drop-down list.

 

LoadBalance_WebSphere02

 

Clic on Next.

Review the summary window to ensure the settings are correct and click on Finish .

 

Back in the list of Web servers, tick the recently registered Web server, and then click on the Generate plug-in button.

Once this has been completed, click on the Propagate plug-in button:

 

LoadBalance_WebSphere03

 

With the latter, the set configuration will be applied to all nodes in your cluster.

Make sure you click on Save to update changes.