此内容没有您所选择的语言版本。
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 (
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
Follow this procedure to install JBoss HTTP Connector on a JBoss Enterprise Application Platform instance and configure it for non-clustered operation.
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"/>
<Listener className="org.jboss.web.tomcat.service.deployers.MicrocontainerIntegrationLifecycleListener" delegateBeanName="ModClusterService"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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>
<depends>ModClusterService</depends>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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">
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="worker01">Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
/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 saveCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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!!!
[warning] mod_advertise: ServerAdvertise Address or Port not defined, Advertise disabled!!!Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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
- 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"/>
<Listener className="org.jboss.modcluster.ModClusterListener" advertise="true" stickySession="true" stickySessionForce="false" stickySessionRemove="true"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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">
<Engine name="Catalina" defaultHost="localhost" jvmRoute="worker01">Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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"
/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"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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!!!
[warning] mod_advertise: ServerAdvertise Address or Port not defined, Advertise disabled!!!Copy to Clipboard Copied! Toggle word wrap Toggle overflow