Você está na página 1de 3

Steps for setting up the cluster 1. Install tomcat on two different vms.

In Blues case they have been installed on inblrll781.dhcp.blrl.sap.corp and inblrll782.dhcp.blrl.sap.corp. The logins for both machines has already been shared Username: lroot Password : devadmin2$ 2. Install Apache web server on one of the vm. This acts as a load balancer between the two tomcat instances. 3. Under TOMCAT_HOME on inblrll781.dhcp.blrl.sap.corp .Open the server.xml file under conf directory. This file has been modified to have the following entries for the cluster and session replication to work.
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8"> <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/> <Channel className="org.apache.catalina.tribes.group.GroupChannel"> <Membership className="org.apache.catalina.tribes.membership.McastService" address="228.0.0.4" port="45564" frequency="500" dropTime="3000"/> <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver" address="auto" port="4000" autoBind="100" selectorTimeout="5000" maxThreads="6"/> <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/> </Sender> <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/> <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Inter ceptor"/> </Channel> <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/> <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/> <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer" tempDir="/tmp/war-temp/"

deployDir="/tmp/war-deploy/" watchDir="/tmp/war-listen/" watchEnabled="false"/> <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/> <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/> </Cluster>

4. Modify web.xml for the blue app on both vms. Add this entry <distributable /> .This makes the app to allow session replication across the vm boundaries 5. Goto /home/smjain/apache/conf directory of inblrll781.dhcp.blrl.sap.corp vm. Open httpd.conf file. There are 2 entries added here
JkWorkersFile /home/smjain/apache/conf/worker.properties JkMount /* loadbalancer

6. There is also a worker.properties file created. The entries in the file are
worker.list=loadbalancer # Set worker properties worker.node1.type=ajp13 worker.node1.host=localhost worker.node1.port=8009 worker.node1.lbfactor=50 worker.node2.type=ajp13 worker.node2.host=INBLRLL782.dhcp.blrl.sap.corp worker.node2.port=8009 worker.node2.lbfactor=100 #setup the load-balancer worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1,node2 worker.loadbalancer.sticky_session=True #worker.loadbalancer.sticky_session_force=True These entries refer to the connection from the web server to the tomcat servers via an ajp protocol

7. After this start the tomcat instances. 8. Start the Apache web server on inblrll781.dhcp.blrl.sap.corp (go to /home/smjain/apache/bin. Issue command ./apachectl start). Once this is done you can access the Blue app via the load balancer using this url (http://inblrll781.dhcp.blrl.sap.corp/dancingSparrow/login.jsf)

Você também pode gostar