Configuring Web Servers for HTTP Load Balancing

The load balancer plug-in installation program makes a few modifications to the web server’s configuration files. The changes made depend upon the web server.

Note
The load balancer plug-in can be installed either along with Sun Java System Application Server Enterprise Edition, or separately, on a machine running the supported web server.
For complete details on the installation procedure, see Sun Java System Application Server Installation Guide.

Modifications to Sun Java System Web Server

The installation program makes the following changes to the Sun Java System Web Server’s configuration files:
  1. Adds the following load balancer plug-in specific entries to the web server instance’s magnus.conf file:
  2. ##EE lb-plugin Init fn="load-modules" shlib="web_server_install_dir/plugins/lbplugin/bin/libpassthrough.so" funcs="init-passthrough,service-passthrough,name-trans-passthrough" Thread="no"
    Init fn="init-passthrough"
    ##end addition for EE lb-plugin
  3. Adds the following entries specific to the load balancer plug-in to the web server instance’s obj.conf file:
  4.  NameTrans fn="name-trans-passthrough" name="lbplugin" config-file="web_server_install_dir/web_server_instance/config/loadbalancer.xml" ObjectType fn="force-type" type="magnus-internal/lbplugin" PathCheck fn="deny-existence" path="*/WEB-INF/*" Service type="magnus-internal/lbplugin" fn="service-passthrough" Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"
    lbplugin is a name that uniquely identifies the Object, and web_server_install_dir/web_server_instance/config/loadbalancer.xml is the location of the XML configuration file for the virtual server on which the load balancer is configured to run.
After installing, configure the load balancer

Modifications to Apache Web Server

Before installing the load balancer plug-in on Apache, see information on compiling and configuring Apache

Modifications Made by the Installer

The load balancer plug-in installation program extracts the necessary files to the libexec (Apache 1.3) or modules (Apache 2.0) folder under the web server’s root directory. It adds the following entries specific to the load balancer plug-in to the web server instance’s httpd.conf file:
 machine_name:443>
##Addition for EE lb-plugin
LoadFile /usr/lib/libCstd.so.1
LoadModule apachelbplugin_module libexec/mod_loadbalancer.so
#AddModule mod_apachelbplugin.cpp

  config-file 
webserver_instance/conf/loadbalancer.xml
locale en
machine_ip_address>
DocumentRoot "
webserver_instance/htdocs"
ServerName server_name
##END EE LB Plugin ParametersVersion 7

Note
  • On Apache 1.3, when more than one Apache child processes runs, each process has its own load balancing round robin sequence.

    For example, if there are two Apache child processes running, and the load balancing plug-in load balances on to two application server instances, the first request is sent to instance #1 and the second request is also sent to instance #1. The third request is sent to instance #2 and the fourth request is sent to instance #2 again. This pattern is repeated (instance1, instance1, instance2, instance2, etc.)

    This behavior is different from what you might expect, that is, instance1, instance2, instance1, instance2, etc. In Sun Java System Application Server, the load balancing plug-in for Apache instantiates a load balancer instance for each Apache process, creating an independent load balancing sequence.
  • Apache 2.0 has multithreaded behavior if compiled with the --with-mpm=worker option.

Modifications After Installation

Additional Modifications on Microsoft Windows

If you are running Apache on Microsoft Windows, after installing the plug-in, some environment variable changes are required:
Add a new path to the Path environment variable by clicking Start->Settings->Control Panel->System->Advanced->Environment Variables->System Variables. Edit the Path variable to include the following:
application_server_install_dir/bin
In addition, set the environment variable NSPR_NATIVE_THREADS_ONLY to 1 before starting Apache web server.
On the Environment Variables window, under System Variables, click New.Enter the following name and value pair:
Variable name: NSPR_NATIVE_THREADS_ONLY
Variable value: 1
Restart the machine.

Modifications to Microsoft IIS

To configure Microsoft Internet Information Services (IIS) to use the load balancer plug-in, modify certain properties in Windows Internet Services Manager. The Internet Services Manager is located in the Administrative Tools folder in the Control Panel folder.
Make these modifications after installing the Sun Java System Application Server.
  1. Open the Internet Services Manager.
  2. Select the web site for which you want to enable the plug-in. This web site is typically named the Default Web Site.
  3. Right click on the web site and select Properties to open the Properties notebook.
  4. To add a new ISAPI filter, open the ISAPI Filters tab, click Add, and follow the steps given below:
    1. In the Filter Name field, enter Application Server
    2. In the Executable field, type C:\Inetpub\wwwroot\sun-passthrough\sun-passthrough.dll
    3. Click OK, and close the Properties notebook.
  5. Create and configure a new virtual directory:
    1. Right click on the default web site, select New, and then Virtual Directory.
    2. The Virtual Directory Creation Wizard opens.
    3. In the Alias field, type sun-passthrough.
    4. In the Directory field, type C:\Inetpub\wwwroot\sun-passthrough
    5. Check the Execute Permission checkbox. Leave all other permission-related check boxes are left unchecked.
    6. Click Finish.
  6. Add the path of sun-passthrough.dll file and application_server_install_dir/bin to the system’s PATH environment variable. Restart the machine.
  7. Stop and start the web server for the new settings to take effect.
  8. To stop the web server, right click on the web site and select Stop. To start the web server, right click on the web site and select Start.
    Next, type the following in a web browser to access the web application context root:
    http://webserver_name/web_application
    where webserver_name is the hostname or IP address of the web server and /web_application is the context root that you listed in the C:\Inetpub\wwwroot\sun-passthrough\sun-passthrough.properties file. Verify that the web server, load balancer plug-in, and Application Server are operating correctly.
The installer automatically configures the following properties in sun-passthrough.properties. You can change the default values.

Table : Automatically configured sun-passthrough.properties for Microsoft IIS
Property
Definition
Default Value
lb-config-file
Path to the load balancer configuration file
IIS_www_root\sun-passthrough\loadbalancer.xml
log-file
Path to the load balancer log file
IIS_www_root\sun-passthrough\lb.log
log-level
Log level for the web server
INFO

Configuring Multiple Web Server Instances

The Sun Java System Application Server installer does not allow the installation of multiple load balancer plug-ins on a single machine. To have multiple web servers with the load balancer plug-in on a single machine, in either a single cluster or multiple clusters, a few manual steps are required to configure the load balancer plug-in.
  1. Configure the new web server instance to use the load balancer plug-in, as described in "Modifications to Sun Java System Web Server", "Modifications to Apache Web Server", or "Modifications to Microsoft IIS".
  2. Copy the sun-loadbalancer_1_1.dtd file from the existing web server instance’s config directory to the new instance’s config directory.
  3. To use the same load balancer configuration, copy the loadbalancer.xml file from the existing web server instance’s config directory to the new instance’s configdirectory.
  4. To use a different load balancer configuration:
    1. Create a new load balancer configuration using asadmin create-http-lb-config.
    2. Export the new configuration to a loadbalancer.xml file using asadmin export http-lb-config.
    3. Copy that loadbalancer.xml file to the new web server’s config directory.
    4. For information on creating a load balancer configuration and exporting it to a loadbalancer.xml file
 
Copyright © 2005 Tech Rawang - All Rights Reserved
Template By. Catatan Info