8.2. Install and configure a worker node

This section contains a number of tasks. Follow the appropriate task to install and configure a worker node on JBoss Enterprise Application Platform, or JBoss Enterprise Web Server.

Note

Make sure your configuration definition meets the following character limits:
  • Maximum JVMRoute string length: 80 character (JVMRoute in the <Engine> element)
  • Maximum hostname length for a node: 64 characters (hostname address in the <Connector> element)
  • Maximum port length for a node: 7 characters (8009 is 4 characters, the port property in the <Connector> element)
  • Maximum scheme length for a node: 6 characters (possible values are http, https, ajp, the protocol of the connector)

Task: Install and Configure a JBoss Enterprise Application Platform Worker Node

Follow this procedure to install JBoss HTTP Connector on a JBoss Enterprise Application Platform instance and configure it for non-clustered operation.

Prerequisites

  1. Deploy the worker node service

    Copy mod-cluster.sar from the JBOSS_EAP_DIST/mod_cluster directory to jboss-as/server/PROFILE/deploy.
  2. Add a Listener to JBoss Web

    Add the following Listener element beneath the other Listeners in JBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/server.xml:
    <Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener" delegateBeanName="ModClusterService"/>
  3. Configure the service dependency

    Add the following depends element beneath the other depends elements in JBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/META-INF/jboss-beans.xml:
    <depends>ModClusterService</depends>
  4. Give the worker a unique identity

    Edit JBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/server.xml and add a jvmRoute attribute and value to the Engine element, as shown:
    <Engine name="jboss.web" defaultHost="localhost" jvmRoute="worker01">
    Use a unique jvmRoute value for each node.
  5. Optional: Configure firewall to receive multicast Proxy Server advertisements

    A proxy server using the JBoss HTTP Connector can advertise itself via UDP multicast. To enable the worker node to dynamically discover proxy servers, open port 23364 for UDP connections on the worker node's firewall.
    Use the following command on Red Hat Enterprise Linux to achieve this:
    /sbin/iptables -A INPUT -m state --state NEW -m udp -p udp --dport 23364 -j ACCEPT 
    -m comment --comment "receive mod_cluster proxy server advertisements"
    /sbin/iptables save
    If you are not using Automatic Proxy Discovery (see Automatic Proxy Discovery), configure worker nodes with a static list of proxies. Refer to Section 9.1, “Static proxy configuration” for directions. In this case you can safely ignore the following warning message:
    [warning] mod_advertise: ServerAdvertise Address or Port not defined, Advertise disabled!!!

    Important

    If your nodes are on different machines that run Red Hat Enterprise Linux, they may not acknowledge each other automatically. JBoss Clustering relies on the UDP (User Datagram Protocol) multicasting provided by jGroups. Red Hat Enterprise Linux blocks these packets by default.
    To allow the packets, modify the iptables rules (as root). The following commands apply to an IP address that matches 192.168.1.x:
    /sbin/iptables -I RH-Firewall-1-INPUT 5 -p udp -d 224.0.1.0/24 -j ACCEPT
    /sbin/iptables -I RH-Firewall-1-INPUT 5 -p udp -d 224.0.0.0/4 -j ACCEPT
    /sbin/iptables -I RH-Firewall-1-INPUT 9 -p udp -s 192.168.1.0/24 -j ACCEPT
    /sbin/iptables -I RH-Firewall-1-INPUT 10 -p tcp -s 192.168.1.0/24 -j ACCEPT
    /etc/init.d/iptables save
    

Task: Install and Configure a JBoss Enterprise Web Server Worker Node

Follow this procedure to install the JBoss HTTP Connector on a JBoss Enterprise Web Server node and configure it for non-clustered operation.

Prerequisites

  1. Deploy worker node service

    Copy all of the library files in the JBOSS_EAP_DIST/mod_cluster/JBossWeb-Tomcat/lib directory. Move these files to JBOSS_EWS_DIST/tomcat6/lib/
  2. Add a Listener to Tomcat

    Add the following Listener element beneath the other Listener elements in JBOSS_EWS_DIST/tomcat6/conf/server.xml.
    <Listener className="org.jboss.modcluster.ModClusterListener" advertise="true" stickySession="true" stickySessionForce="false" stickySessionRemove="true"/>
  3. Give this worker a unique identity

    Edit JBOSS_EWS_DIST/tomcat6/conf/server.xml and add a jvmRoute attribute and value to the <Engine> element, as shown:
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="worker01">
  4. Optional: Configure firewall to receive Proxy Server advertisements

    A proxy server using the JBoss HTTP Connector can advertise itself via UDP multicast. To receive these multicast messages, open port 23364 for UDP connections on the worker node's firewall.
    For Linux users:
    /sbin/iptables -A INPUT -m state --state NEW -m udp -p udp --dport
     23364 -j ACCEPT 
    -m comment -comment "receive mod_cluster proxy server advertisements"
    If you are not using Automatic Proxy Discovery (see Automatic Proxy Discovery), configure worker nodes with a static list of proxies. Refer to Section 9.1, “Static proxy configuration” for directions. In this case you can safely ignore the following warning message:
    [warning] mod_advertise: ServerAdvertise Address or Port not defined, Advertise disabled!!!