Summary: Provides dynamic load balancing integration with an Apache httpd server.
OverviewGigaSpaces comes with a built-in utility allowing you to dynamically update an Apache httpd web server load-balancing configuration, based on deployed web applications. The integration dynamically creates and updates the mod_proxy_balancer configuration, based on the state of the deployed web applications. Once changes occur (relocation / failover / changes to the number of web application instances), the utility identifies the change, updates the balancer configuration, and sends a soft restart to Apache to take the new configuration into account. General information on how to enable the mod_proxy load balancer and configuration can be found in the Jetty mod_proxy docs. Note, the load balancer actual configuration of specific balancer members are generated automatically as explained below. UsageThe tool resides within GSHOME/tools/apache and includes the apache-lb-agent script. The script should run within the same box where the Apache server is running. The agent uses two main configurations. The first is the directory where the load-balancer configuration files are created (there is one per web application). The second is the command the script executes in order to update Apache with the changes made to the load-balancer configuration files. By default, the script assumes that Apache is installed under PROGRAM_FILES/Apache Software Foundation/Apache2.2 for apache-lb-agent.sh -apache /opt/apache When using just the Apache location, the configuration files are created under [apache]/conf/gigaspaces. The command executed is [apache]/bin/apachectl graceful on Unix, and [apache]\bin\httpd.exe -k restart on Windows. The specific location of the configuration directory where the load-balancer configuration files are created, can be passed using the -conf-dir command line parameter. For example: apache-lb-agent.sh -apache /opt/apache -conf-dir /var/apache/conf/gigaspaces
The apachectl/httpd.exe location can also be controlled using the -apachectl command line parameter. Finally, the full restart command can be passed using the -restart-command command line parameter. The agent updates the configuration files and sends the restart command periodically. All changes happening to the deployment are accumulated and then flushed, by default, every 10,000 milliseconds (10 seconds). The update interval command can be controlled using the -update-interval command line parameter. The agent listens for changes happening in the deployment topology (the web application instances) running within the Service Grid. If custom lookup groups or lookup locators are used, the agent scripts use the built-in options within the product to change them (for example, in setenv.(bat/sh)). The agent also allows you to change the groups/locators, using the command line parameters: -groups for groups and -locators for locators. Load Balancer ConfigurationA load-balancer configuration is created for each web application deployed into the service grid. The template used to generate the load-balancer configuration can be found under GSHOME/tools/apache/balancer-template.vm. The file is a velocity template, used to generate the actual load-balancer configuration. It is passed with an instance of the org.openspaces.pu.container.jee.lb.apache.LoadBalancerInfo object, which holds all the information regarding the currently deployed web application instances locations. Processing unit specific templates can be created by placing a processing unit name.vm file in the same location. Note, the processing unit name is the name of the processing unit which defaults to the war file name, but can be overridden using the override-name feature. |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |