Chapter 4. Configuration example for load-balancing with mod_proxy_cluster


You can configure JBCS to use the mod_proxy_cluster connector for load-balancing in a Red Hat Enterprise Linux system.

When you want to configure a load-balancing solution that uses mod_proxy_cluster, you must perform the following tasks:

4.1. Setting up JBCS as a proxy server

When you configure JBCS to use mod_proxy_cluster, you must set up JBCS as a proxy server by specifying configuration details in the mod_proxy_cluster.conf file.

Procedure

  1. Go to the JBCS_HOME/httpd/conf.d/ directory.
  2. Create a file named mod_proxy_cluster.conf.
  3. Enter the following configuration details:

    LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
    LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
    LoadModule manager_module modules/mod_manager.so
    LoadModule advertise_module modules/mod_advertise.so
    
    MemManagerFile cache/mod_proxy_cluster
    
    <IfModule manager_module>
      Listen 6666
      <VirtualHost *:6666>
        <Location />
          Require ip 127.0.0.1
        </Location>
        ServerAdvertise on
        EnableMCMPReceive
        <Location /mod_cluster_manager>
          SetHandler mod_cluster-manager
          Require ip 127.0.0.1
       </Location>
      </VirtualHost>
    </IfModule>
    Important

    As shown in the preceding example, the mod_proxy_cluster package requires that you set the MemManagerFile directive in the conf.d file to cache/mod_proxy_cluster.

    If you specify the EnableMCMPReceive directive in your virtual host, the Apache HTTP Server requires that you always use Location elements rather than Directory elements in the virtual host definition. From JBCS 2.4.62 onward, the Apache HTTP Server does not support the use of Directory elements and the EnableMCMPReceive directive within the same virtual host. If you specify a Directory element and the EnableMCMPReceive directive within the same virtual host, the Apache HTTP Server fails to start and logs an error indicating that you should use a Location element instead. The startup failure was introduced in JBCS 2.4.62 as a breaking change that is not compatible with earlier releases.

    Note

    The preceding example shows how to set up JBCS as a proxy server that is listening on localhost.

4.2. Configuring a Tomcat worker node

When you configure JBCS to use mod_proxy_cluster, you must configure a Tomcat worker node by adding a Listener element to the server.xml file.

Prerequisites

Procedure

  1. Open the JWS_HOME/tomcat<VERSION>/conf/server.xml file.
  2. Add the following Listener element:

    <Listener className="org.jboss.modcluster.container.catalina.standalone.ModClusterListener" advertise="true"/>

4.3. Defining iptables firewall rules example

When you configure JBCS to use mod_proxy_cluster, you must define firewall rules by using iptables.

Prerequisites

Procedure

  • Use iptables to define a set of firewall rules.

    For example:

    /sbin/iptables -I INPUT 5 -p udp -d 224.0.1.0/24 -j ACCEPT -m comment --comment "mod_proxy_cluster traffic"
    /sbin/iptables -I INPUT 6 -p udp -d 224.0.0.0/4 -j ACCEPT -m comment --comment "JBoss Cluster traffic"
    /sbin/iptables -I INPUT 9 -p udp -s 192.168.1.0/24 -j ACCEPT -m comment --comment "cluster subnet for inter-node communication"
    /sbin/iptables -I INPUT 10 -p tcp -s 192.168.1.0/24 -j ACCEPT -m comment --comment "cluster subnet for inter-node communication"
    /etc/init.d/iptables save
    Note

    The preceding example shows to define firewall rules for a cluster node on the 192.168.1.0/24 subnet.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top