Load balancing WebSphere Message Broker HTTP traffic: Part 2: Load balancing with Apache HTTP Server

WebSphere Message Broker V8 lets you generate a configuration file to enable HTTP load balancing in IBM HTTP Server and Apache HTTP Server. Part 1 of this two-part series showed you how to configure load balancing for WebSphere Message Broker HTTP traffic using the WebSphere Plug-in and IBM HTTP Server. Part 2 shows you how to use the Message Broker V8 Java APIs and Message Broker Explorer to configure load balancing for the Apache HTTP server, using the mod_proxy and mod_proxy_http mod_proxy_balancer Apache modules.

Rahul Gupta (rahul.gupta@us.ibm.com), Advisory IT Specialist, IBM

Photo of Rahul GuptaRahul Gupta is an Advisory IT Specialist with IBM Global Technology Services. He is a Certified SOA Architect with eight years experience in IBM messaging technologies, and currently, he works as a middleware consultant for various clients in North America. His core experience is in lab testing, performance tuning, and development for WebSphere Message Broker and WebSphere MQ. He has been a speaker on messaging-related topics at various WebSphere conferences, and has been recognized as an inventor by the IBM Innovation Community. He has also authored IBM Redbooks and developerWorks articles on messaging and application infrastructure. You can contact Rahul at rahul.gupta@us.ibm.com.



Devipriya Selvarajan (dselvara@in.ibm.com), Messaging Consultant, IBM

Photo of Devipriya SelvarajanDevipriya Selvarajan is a Messaging Consultant on the WebSphere Lab Services team. She handles Business Partner enablement for WebSphere Transformation Extender, WebSphere Message Broker, WebSphere MQ, and WebSphere DataPower SOA Appliances. You can contact Devipriya at dselvara@in.ibm.com.



28 August 2013

Introduction

Load balancing is a method of distributing workload in computer networks. It optimizes the utilization of available resources and avoids overloading specific resources at peak times, with the goal of maximizing the throughput and performance of the system. Computer clusters rely on load balancing to distribute workload across network links, CPUs, and web servers.

A web farm is a common use of load balancing, with web servers seamlessly providing a single virtual service. The load balancer accepts requests from HTTP clients and forwards them to one of the available back-end servers or services according to a scheduling algorithm. Load balancers can be implemented using dedicated hardware or software. This article describes the new feature in IBM® WebSphere® Message Broker V8 to generate a mod_proxy configuration module to load balance HTTP traffic in the Apache web server. Figure 1 below shows the load balancing of messages across different application instances in the system:

Figure 1. Load balancing overview
Load balancing overview

To implement this solution, you would need active HTTP services processing on multiple instances of WebSphere Message Broker. The method of load balancing depends on parameters defined in the load balancer, such as: by traffic, by requests, or by pending requests.

HTTP Server

A web server is a server that accepts HTTP requests from web clients and serves them HTTP responses, usually in the form of web pages containing static (text and images) and dynamic (scripts) content. The Apache HTTP Server has been the most widely used open-source web server for the last decade. The Apache HTTP Server is lightweight and robust, and used in small as well as large corporations. It is available for multiple platforms and is used in a variety of scenarios due to its great modularity, which enables it to be integrated with many other applications. For more information, see Apache HTTP Server at Apache.org.

Apache modules

The Apache HTTP Server consists of a small core for HTTP request/response processing, plus multi-processing modules (MPMs) that dispatch data processing to threads and/or processes. Many additional modules are available to extend the core functionality for special purposes This article will focus on the mod_proxy modules of the Apache HTTP Server, and show you how to configure them to load-balance HTTP traffic for services hosted on WebSphere Message Broker.

Apache module mod_proxy

Mod_proxy is an optional module for the Apache HTTP Server. This module implements a proxy, gateway, and cache. It implements proxying capability for Apache JServ Protocol version 1.3 (AJP13), FTP, CONNECT (for SSL), HTTP 0.9, HTTP 1.0, and (since Apache 1.3.23) HTTP 1.1. The module can be configured to connect to other proxy modules for these and other protocols. Apache features are divided into several modules in addition to mod_proxy:

  • mod_proxy_http
  • mod_proxy_ftp
  • mod_proxy_ajp
  • mod_proxy_balancer
  • mod_proxy_connect

For more information, see Apache module mod_proxy at Apache.org.

Apache module mod_proxy_http

This module requires the service of mod_proxy. It provides the features used for proxying HTTP requests. Mod_proxy_http supports HTTP 0.9, HTTP 1.0 and HTTP 1.1. For more information about the Apache mod_proxy_http module, see Apache module mod_proxy_http at Apache.org.

Apache module mod_proxy_balancer

The Apache mod_proxy_balancer module has been available since Apache HTTP Server V2.1. It turns an Apache HTTP Server into a load balancer that can retrieve requested pages from two or more back-end servers and deliver them to an HTTP client. The mod_proxy_balancer module was added to provide load-balancing services for the main mod_proxy module. The load balancer enables requests to be shared among back-end servers using these three modules:

  • mod_lbmethod_byrequests
  • mod_lbmethod_bytraffic
  • mod_lbmethod_bybusyness

Three load balancer scheduler algorithms are available and are described below: Request Counting, Weighted Traffic Counting, and Pending Request Counting. They are controlled via the lbmethod value of the balancer definition. The default algorithm for load balancing is Request Counting, which uses the mod_lbmethod_byrequests module.

  • Request Counting -- Incoming requests are distributed among back-end servers such that each one gets a proportional number of requests, as defined by the loadfactor variable.
  • Weighted Traffic Counting -- Similar to Request Counting, except that Weighted Traffic Counting considers the number of bytes instead of the number of requests.
  • Pending Request Counting -- The Scheduler keeps track of the number of requests assigned to each back-end server at any given time. Each new incoming request is then sent to the server with the least number of pending requests -- the one that is least loaded. This algorithm helps keep the request queues even, and each request usually goes to the server that can process it the fastest.

For more information, see Apache module mod_proxy_balancer at Apache.org.

Using external web servers with WebSphere Message Broker

mod_proxy modules will work as adhesives between an Apache HTTP Server and WebSphere Message Broker. The primary responsibility of the mod_proxy module is to forward HTTP requests from Apache HTTP Web server to WebSphere Message Broker. The mod_proxy modules are loaded into an Apache HTTP server instance, and they examine incoming requests to determine if the request needs to be routed to a specific instance of WebSphere Message Broker. The mod_proxy module examines the host and port combination along with the requested URL and determines whether to send the request on to WebSphere Message Broker. Once a response is given from WebSphere Message Broker, the mod_proxy module matches up the response with the original request from the client, and passes the data back. Failover support is also a crucial consideration for web services infrastructure. When a server fails, the mod_proxy module detects the failure, marks the server unavailable, and routes requests to other available cluster members. Figure 2 below shows the Apache HTTP web server topology that uses mod_proxy modules to handle HTTP and HTTPS connections for WebSphere Message Broker:

Figure 2. Load balancing WebSphere Message Broker HTTP traffic through mod_proxy modules
Load balancing WebSphere Message Broker HTTP traffic through mod_proxy modules

You can use WebSphere Message Broker V8 to generate the most appropriate type of configuration data:

  • If the topology incorporates IBM HTTP Server and WebSphere Plug-in, generate a configuration file that can be loaded through httpd.conf file of IBM HTTP Server.
  • If the topology incorporates an Apache HTTP server and Apache mod_proxy modules, generate a configuration file that can be merged and loaded through httpd.conf file of Apache HTTP Server.
  • If the topology is not described in the previous options, use WebSphere Message Broker API to generate a per-broker list of port and URL data in CSV format, which you can then use in many kinds of web server configurations.

These configuration files generated from the WebSphere Message Broker runtime are templates, and may not be production-ready. Manual editing may be required to configure the load balancing parameters.

This article shows you how to configure the WebSphere Message Broker topology shown in Figure 2 above. You will generate configuration data that can be used by Apache HTTP Server and the Apache mod_proxy modules using both WebSphere Message Broker V8 Explorer, and the WebSphere Message Broker V8 Java API.

Configuring the environment

To set up load-balancing configuration with WebSphere Message Broker V8, use an existing broker and message flow application with two Linux and one Windows servers:

  • jkentpbrk1.procurement.jk.enterprise.com (SUSE 11 Enterprise Linux)
  • jkentpbrk2.procurement.jk.enterprise.com (SUSE 11 Enterprise Linux)
  • procurement.jk.enterprise.com (Windows 7)

Figure 3 shows components of the broker through WebSphere Message Broker Explorer:

Figure 3. WebSphere Message Broker runtime components
WebSphere Message Broker runtime components

Table 1 shows components created on host jkentpbrk1.procurement.jk.enterprise.com:

Table 1. Components created on host jkentpbrk1.procurement.jk.enterprise.com
ComponentConfiguration detail
Queue managerJKENTPQM1
Queue manager listener port4414
BrokerJKENTPBRK1
Execution groupJKRENTPEG1
HTTPConnector port30001
Application nameJKEnterpriseProcurement

Table 2 shows components created on host jkentpbrk2.procurement.jk.enterprise.com:

Table 2. Components created on host jkentpbrk2.procurement.jk.enterprise.com
ComponentConfiguration detail
Queue managerJKENTPQM2
Queue manager listener port3414
BrokerJKENTPBRK2
Execution groupJKRENTPEG2
HTTPConnector port30001
Application nameJKEnterpriseProcurement

Table 3 shows components created on host procurement.jk.enterprise.com:

Table 3. Components created on host procurement.jk.enterprise.com
ComponentConfiguration detail
Apache HTTP ServerListening port 80
Apache mod_proxy modulemod_proxy configuration

Application message flow

Figure 4 below shows the WebSphere Message Broker application used in this article. It is a High Value Procurement application that receives order information in the form of SOAP requests, and then updates the database with the order data. A SOAP Success response is sent back to the client if the order is successfully committed in the database, while a SOAP Fault is sent for any problems:

Figure 4. High Value Procurement application
High Value Procurement application

Generating Apache HTTP server configuration using WebSphere Message Broker V8 Explorer

  1. In the WebSphere MQ Explorer Navigator view, select the brokers for which you want to generate a configuration file. If you want to work with multiple brokers, hold down the Ctrl key while selecting the brokers. Figure 5 below shows the feature in WebSphere Message Broker Explorer to generate mod_proxy module configuration
  2. Right-click the selected brokers and select Export Port Configuration
  3. Select the configuration that you want to export
    • If you want to use the mod_proxy module configuration, select mod_proxy module configuration
    • In the Save As dialog, navigate to a target location for the configuration file, and enter the file name of your choice
    • Click Save to save the file
Figure 5. Generating mod_proxy module from WebSphere Message Broker Explorer
Generating mod_proxy module from WebSphere Message Broker Explorer

Generating Apache HTTP server configuration using WebSphere Message Broker API

This section of the article shows you how to use WebSphere Message Broker V8 Java API to generate configuration data for mod_proxy module and Apache HTTP Server. Use the WebSphere Message Broker API method generateModProxyPlugin() in class com.ibm.broker.config.proxy.BrokerProxy to generate this configuration. Use method getPortConfigAsCSV() in class com.ibm.broker.config.proxy.BrokerProxy to retrieve port and URL data for an individual broker in CSV format. Listing 1 provides an overview of these methods:

Listing 1. generateModProxyPlugin( )and getPortConfigAsCSV( ) method in class BrokerProxy
public static String generateModProxyPlugin (Map <BrokerProxy,String>brokerHostMap,
long timeoutInMilliseconds) throws ConfigManagerProxyLoggedException
public static String getPortConfigAsCSV() throws ConfigManagerProxyLoggedException

Start by creating a Java Project in eclipse or WebSphere Message Broker toolkit, and create three Java classes:

  • WriteModProxyFile
  • BrokerConnectionDetails
  • GenerateModProxy

WriteModProxyFile

The purpose of this class is to capture the name and location of Plug-in configuration file to be created. Also this class captures data from generateModProxyPlugin() method and then serializes this data into the configuration file. Listing 2 contain Java implementation of this class:

Listing 2. Class WriteModProxyFile
public class WriteModProxyFile {
   private String fileName     = null;
   private String fileLocation = null;
   private String fileData     = null;

   public WriteModProxyFile(String fileName, 
         String fileLocation, String fileData) {
      this.fileName     = new String(fileName);
      this.fileLocation = new String(fileLocation);
      this.fileData     = new String(fileData);
   }

   public WriteModProxyFile() {
      this.fileName     = new String();
      this.fileLocation = new String();
      this.fileData     = new String();
   }

   public String getFileName() {
      return fileName;
   }

   public void setFileName(String fileName) {
      this.fileName = fileName;
   }

   public String getFileLocation() {
      return fileLocation;
   }

   public void setFileLocation(String fileLocation) {
      this.fileLocation = fileLocation;
   }

   public String getFileData() {
      return fileData;
   }

   public void setFileData(String fileData) {
      this.fileData = fileData;
   }

   public void writeDataToFile() {
      FileWriter fileWriter = null;
   try {
         String absoluteFileName = this.fileLocation + 
         "/" + this.fileName;
         File newTextFile = new File(absoluteFileName);
         fileWriter = new FileWriter(newTextFile);
         fileWriter.write(this.fileData);
         fileWriter.close();
      } catch (IOException ex) {
         ex.printStackTrace();
      } finally {
      try {
            fileWriter.close();
         } catch (IOException ex) {
            ex.printStackTrace();
         }
      }
   }
}

Java Class -- BrokerConnectionDetails

The purpose of this class is to capture connection details of the specific instance of broker in runtime. Details about broker host name, Queue Manager name and Queue Manager listener port are captured in instantiated object if this class. Listing 3 contains Java implementation of this class:

Listing 3. Class BrokerConnectionDetails
public class BrokerConnectionDetails {

   private String hostname     = null;
   private String portNumber   = null;
   private String qManagerName = null;

   public BrokerConnectionDetails() {
      this.hostname     = new String();
      this.portNumber   = new String();
      this.qManagerName = new String();
   }

   public BrokerConnectionDetails(String hostname, 
      String portNumber, String qManagerName) {
      this.hostname     = new String(hostname);
      this.portNumber   = new String(portNumber);
      this.qManagerName = new String(qManagerName);
   }

   public String getHostname() {
      return hostname;
   }

   public void setHostname(String hostname) {
      this.hostname = hostname;
   }

   public String getPortNumber() {
      return portNumber;
   }

   public void setPortNumber(String portNumber) {
      this.portNumber = portNumber;
   }

   public String getqManagerName() {
      return qManagerName;
   }

   public void setqManagerName(String qManagerName) {
      this.qManagerName = qManagerName;
   }

}

Java Class - GenerateModProxy

This class contains the Java main() method. The purpose of this class is to interact with user, capture broker connection details like Broker host name, Broker Queue Manager name, Broker Queue Manager listener port number. Once these details are captured then using WebSphere Message Broker API it generates the mod_proxy configuration file in collaboration with two classes created above. Listing 4 contain pseudo implementation of this Java class. You can download Java project archive from the download section of this article.

Listing 4. Class GenerateModProxy
public static void main(String[] args){

   // read connection details for different Broker Connection
   
   // get instance of each brokerProxy
   bcp[count] = new MQBrokerConnectionParameters(brokerConnection[count].getHostname(),
      Integer.parseInt(brokerConnection[count].getPortNumber()),
                       brokerConnection[count].getqManagerName());

   bp[count] = BrokerProxy.getInstance(bcp[count]);

   // use generateModProxyPlugin method from BrokerProxy class to generate plugin 
   mpf.setFileData(BrokerProxy.generateModProxyPlugin(mp,16000));

   // use WritePlugin class to write plugin contents into a file
   mpf.WriteModProxyFile();

   // complete Java class code could be downloaded from download section
   }
}

Execute GenerateModProxy application

Listing 5 below shows how the Java application created above would be used to create the mod_proxy configuration for load balancing. In the example below the mod_proxy configuration file is created in conf folder of Apache HTTP Server installation.

Listing 5. Mod_proxy generation using WebSphere Message Broker API Java application
=========================================================================================
*****************************************************************************************
**************WebSphere Message Broker Mod Proxy Balancer Generation Tool****************
*****************************************************************************************
=========================================================================================

Do you want to add Broker Connection Details ? (y/n) = Y

*****************************************************************************************

Please Enter the Broker Connection Details ( Hostname, QMName , QMPort )
Enter the Broker Hostname                      = jkentpbrk2.procurement.jk.enterprise.com
Enter the Queue Manager Name                   = JKENTPQM2
Enter the Queue Manager Listener Port Number   = 3414

Broker HTTP Service Details for this Broker Connection
Broker,HTTP/HTTPS,Port,URL,Execution Groups....
JKENTPBRK2,HTTP,30001,/JKEnterpriseCreateOrder,JKRENTPEG2

Do you want to add Broker Connection Details ? (y/n) = Y

*****************************************************************************************

Please Enter the Broker Connection Details ( Hostname, QMName , QMPort )
Enter the Broker Hostname                      = jkentpbrk1.procurement.jk.enterprise.com
Enter the Queue Manager Name                   = JKENTPQM1
Enter the Queue Manager Listener Port Number   = 4414

Broker HTTP Service Details for this Broker Connection
Broker,HTTP/HTTPS,Port,URL,Execution Groups....
JKENTPBRK1,HTTP,30001,/JKEnterpriseCreateOrder,JKRENTPEG1

Do you want to add Broker Connection Details ? (y/n) = N

*****************************************************************************************

Enter the file name for Mod Proxy              = mod-proxy.conf
Enter the location of file                     = C:\Program Files (x86)\Apache Software
                                                 Foundation\Apache2.2\conf

=========================================================================================
*****************************************************************************************
****************Congratulation Mod Proxy Balancer Generated Successfully*****************
********************Exiting Mod Proxy Configuration Generation Tool**********************
*****************************************************************************************
=========================================================================================

Mod_proxy_balancer configuration

The sections above showed how to create the mod proxy balancer configuration file using WebSphere Message Broker Explorer and the WebSphere Message Broker API Java application. Listing 6 below shows the mod_proxy configuration file generated by either of these methods:

Listing 6. Mod_proxy_balancer configuration
<Proxy balancer://Cluster_0>
   #Broker:JKENTPBRK1 Execution Groups: JKRENTPEG1
   BalancerMember http://jkentpbrk1.procurement.jk.enterprise.com:30001
   #Broker:JKENTPBRK2 Execution Groups: JKRENTPEG2
   BalancerMember http://jkentpbrk2.procurement.jk.enterprise.com:30001
</Proxy>

ProxyPass /JKEnterpriseCreateOrder balancer://Cluster_0/JKEnterpriseCreateOrder

The mod-proxy configuration file generated from WebSphere Message Broker runtime is intended as a template and may not be production ready. Manual editing could be required to correctly configure the load balancing configuration.

Configure httpd.conf with mod_proxy_balancer configuration

Listing 7 contains the contents to be appended in existing httpd.conf file of Apache HTTP Server. Use the snippet in Listing 7 below for configuring Apache HTTP Server httpd.conf file by including mod_proxy, mod_proxy_http, mod_proxy_balancer modules and balancer configuration from Listing 6 above.

Listing 7. Directives for httpd.conf
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

Include conf/mod-proxy.conf

Testing load balancing and failover

Once the httpd.conf file is configured with mod_proxy directives, we are ready to test the load balancing and failover of application through Apache modules and Apache HTTP Server. Table 4 contains the direct and virtual http URL for accessing the High Value Procurement application:

Table 4. Direct and virtual http URL for accessing the message flow application
HostnameComponentApplication URL
jkentpbrk1.procurement.jk.enterprise.comJKENTPBRK1http://jkentpbrk1.procurement.jk.enterprise.com:30001/JKEnterpriseCreateOrder
Jkentpbrk2.procurement.jk.enterprise.comJKENTPBRK2http://jkentpbrk2.procurement.jk.enterprise.com:30001/JKEnterpriseCreateOrder
procurement.jk.enterprise.comApache HTTP Serverhttp://procurement.jk.enterprise.com/JKEnterpriseCreateOrder

You can test the application using NetTool, SoapUI, or another SOAP testing tools. Figure 6 below shows the input SOAP message and is being sent to http virtual url for broker web service:

Figure 6. Input SOAP request for load balance and failover testing
Input SOAP request for load balance and failover testing

Load balancing test case

Test scenario

This test scenario is to test, if the SOAP requests are getting load balanced between the two instances of the broker. We can delete one of the resources needed by the High Value Procurement application on broker JKENTPBRK1 (ODBC datasource). So when the request is received by this particular broker, the message processing will fail and the web server will receive 500 Internal Server Error from the application. While the other broker will successfully process all the requests that it receives.

Expected test result

Alternate HTTP 200 success and 500 error code in Apache HTTP Server access logs.

Test Case

Send ten HTTP POST request with SOAP messages to the virtual web server url, http://procurement.jk.enterprise.com/JKEnterpriseCreateOrder

Test Results

Listing 8 below shows alternate successful and failure response. The test case results are positive and prove that request were scheduled round robin across both brokers using the WebSphere Plug-in module and Apache HTTP Server. Figure 7 and Figure 8 below illustrate the output of success and failure SOAP request:

Listing 8. Alternate success and failure response entries in Apache HTTP Server access log
[03/Apr/2013:20:35:46 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:20:35:51 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 500 2250
[03/Apr/2013:20:35:52 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:20:35:54 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 500 2250
[03/Apr/2013:20:35:56 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:20:35:58 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 500 2250
[03/Apr/2013:20:36:00 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:20:36:01 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 500 2250
[03/Apr/2013:20:36:03 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:20:36:05 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 500 2250
Figure 7. Success response from application hosted on JKENTPBRK2
Success response from application hosted on JKENTPBRK2
Figure 8. Failure response from application hosted on JKENTPBRK1
Failure response from application hosted on JKENTPBRK1

Failover test case

Test scenario

This test scenario is to test, if the SOAP requests are only directed to active application. Start by stopping the High Value Procurement application hosted on broker JKENTPBRK1, which was replying with 500 internal server errors in previous test case. Plug-in module will recognize the unavailability of the HTTP service on this broker and will the mark the service unavailable. Later all SOAP requests in this test case should be processes successfully by application hosted on broker JKENTPBRK2.

Expected test result

HTTP 200 success code for all ten requests in Apache HTTP Server access logs

Test case

Send ten HTTP POST request with SOAP messages on the virtual web server url, http://procurement.jk.enterprise.com/JKEnterpriseCreateOrder

Test results

Listing 9 below shows successful response for all the HTTP requests. The test case results are positive and prove that requests were directed only to the application which was up and active using the WebSphere Plug-in module and Apache HTTP Server.

Listing 9. Success response entries in access log
[03/Apr/2013:21:00:35 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:39 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:42 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:46 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:47 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:49 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:51 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:53 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:54 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541
[03/Apr/2013:21:00:56 -0500] "POST /JKEnterpriseCreateOrder HTTP/1.1" 200 541

Apache Load Balancer Manager

This tool is packaged with the mod_proxy_balancer module, and allows users to make configurations from a GUI tool through the web browser. Sometimes we may need to change load balancing configuration in runtime, but that may not be easy to do without affecting the running server. For such situations, the Balancer Manager module provides a web interface to change the status of back-end servers in runtime. Append configuration in Listing 10 below to the mod proxy configuration file generated in Listing 6 above.

Listing 10. Load Balancer Manager Configuration
<Location /balancer-manager>
   SetHandler balancer-manager
   Order allow,deny
   Allow from all
</Location>

Restart the Apache HTTP Server and access the Load Balancer Manager using the URL. http://procurement.jk.enterprise.com/balancer-manager (http://apacheHTTPServerHostName/balancer-manager). Figure 9 below shows the load balancer manager tool.

Figure 9. Load Balancer Manager
Load Balancer Manager

Conclusion

This showed you how to use WebSphere Message Broker V8 to generate Apache mod_proxy_balancer module configuration data. This configuration could be used with Apache HTTP server to perform load balancing of inbound HTTP traffic.

Acknowledgements

The authors would like to thank Graham Haxby (Software Developer, IBM WebSphere Message Broker Development), and Regina L. Manuel (Senior Technical Architect, IBM Global Technology Services) for their valuable suggestions and feedback.


Download

DescriptionNameSize
Code sampleModProxyLoadBalancing.zip6 KB

Resources

  • WebSphere Message Broker resources
  • Apache HTTP Server resources
    • Apache HTTP Server
      The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems, and provide a secure, efficient, and extensible server that provides HTTP services in sync with current HTTP standards.
    • Apache module mod_proxy
      The mod_proxy and related modules implement a proxy gateway for Apache HTTP Server, supporting a number of popular protocols and load-balancing algorithms. Third-party modules can add support for additional protocols and load-balancing algorithms.
    • Apache module mod_proxy_http
      This module provides the features used for proxying HTTP and HTTPS requests.
    • Apache module mod_proxy_balancer
      This module provides load balancing support for the HTTP, FTP, and AJP13 protocols.
  • WebSphere resources
    • developerWorks WebSphere
      Technical information and resources for developers who use WebSphere products. developerWorks WebSphere provides product downloads, how-to information, support resources, and a free technical library of more than 2000 technical articles, tutorials, best practices, IBM Redbooks, and online product manuals.
    • developerWorks WebSphere application integration developer resources
      How-to articles, downloads, tutorials, education, product info, and other resources to help you build WebSphere application integration and business integration solutions.
    • Most popular WebSphere trial downloads
      No-charge trial downloads for key WebSphere products.
    • WebSphere forums
      Product-specific forums where you can get answers to your technical questions and share your expertise with other WebSphere users.
    • WebSphere demos
      Download and watch these self-running demos, and learn how WebSphere products can provide business advantage for your company.
    • WebSphere-related articles on developerWorks
      Over 3000 edited and categorized articles on WebSphere and related technologies by top practitioners and consultants inside and outside IBM. Search for what you need.
    • developerWorks WebSphere weekly newsletter
      The developerWorks newsletter gives you the latest articles and information only on those topics that interest you. In addition to WebSphere, you can select from Java, Linux, Open source, Rational, SOA, Web services, and other topics. Subscribe now and design your custom mailing.
    • WebSphere-related books from IBM Press
      Convenient online ordering through Barnes & Noble.
    • WebSphere-related events
      Conferences, trade shows, Webcasts, and other events around the world of interest to WebSphere developers.
  • developerWorks resources
    • Trial downloads for IBM software products
      No-charge trial downloads for selected IBM® DB2®, Lotus®, Rational®, Tivoli®, and WebSphere® products.
    • developerWorks business process management developer resources
      BPM how-to articles, downloads, tutorials, education, product info, and other resources to help you model, assemble, deploy, and manage business processes.
    • developerWorks blogs
      Join a conversation with developerWorks users and authors, and IBM editors and developers.
    • developerWorks tech briefings
      Free technical sessions by IBM experts to accelerate your learning curve and help you succeed in your most challenging software projects. Sessions range from one-hour virtual briefings to half-day and full-day live sessions in cities worldwide.
    • developerWorks podcasts
      Listen to interesting and offbeat interviews and discussions with software innovators.
    • developerWorks on Twitter
      Check out recent Twitter messages and URLs.
    • IBM Education Assistant
      A collection of multimedia educational modules that will help you better understand IBM software products and use them more effectively to meet your business requirements.

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. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. 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=943554
ArticleTitle=Load balancing WebSphere Message Broker HTTP traffic: Part 2: Load balancing with Apache HTTP Server
publish-date=08282013