8.2. Install and configure a worker node
Note
- 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 (
8009is 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
Prerequisites
- Install a supported JBoss Enterprise Application Platform.
- Understand the Proxy Configuration parameters discussed in Appendix B, Reference: Java properties
Deploy the worker node service
Copymod-cluster.sarfrom theJBOSS_EAP_DIST/mod_clusterdirectory tojboss-as/server/PROFILE/deploy.Add a Listener to JBoss Web
Add the followingListenerelement beneath the other Listeners inJBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/server.xml:<Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener" delegateBeanName="ModClusterService"/>
Configure the service dependency
Add the followingdependselement beneath the other depends elements inJBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/META-INF/jboss-beans.xml:<depends>ModClusterService</depends>
Give the worker a unique identity
EditJBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/server.xmland add ajvmRouteattribute and value to theEngineelement, as shown:<Engine name="jboss.web" defaultHost="localhost" jvmRoute="worker01">
Use a uniquejvmRoutevalue for each node.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
Prerequisites
- Install a supported JBoss Enterprise Web Server.
- Understand the Proxy Configuration parameters discussed in Appendix B, Reference: Java properties
Deploy worker node service
Copy all of the library files in theJBOSS_EAP_DIST/mod_cluster/JBossWeb-Tomcat/libdirectory. Move these files toJBOSS_EWS_DIST/tomcat6/lib/Add a Listener to Tomcat
Add the followingListenerelement beneath the other Listener elements inJBOSS_EWS_DIST/tomcat6/conf/server.xml.<Listener className="org.jboss.modcluster.ModClusterListener" advertise="true" stickySession="true" stickySessionForce="false" stickySessionRemove="true"/>
Give this worker a unique identity
EditJBOSS_EWS_DIST/tomcat6/conf/server.xmland add ajvmRouteattribute and value to the <Engine> element, as shown:<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker01">
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!!!

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.