Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

  1. Make a copy of the 'all' server configuration and name it 'node1'. Deploy LAMS here.
    Info
    titleIf using Linux...

    In ${JBOSS_HOME}/bin/run.conf, set -Djava.net.preferIPv4Stack=true in JAVA_OPTS
    See http://wiki.jboss.org/wiki/IPv6 and http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Java/Jboss/Q_22677495.html for reference.

  2. Move lams.ear to /var/lib/lams/lams.ear
  3. Link ${JBOSS_HOME}/server/node1/deploy/lams.ear to /var/lib/lams/lams.ear
  4. In ${JBOSS_HOME}/server/node1/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml, set UseJK to true in order to enable sticky sessions from the Tomcat side.
  5. In ${JBOSS_HOME}/server/node1/deploy/jbossweb-tomcat55.sar/server.xml, give your node a jvmRoute name:
    No Format
    <Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">
    
  6. Delete ${JBOSS_HOME}/server/node1/deploy/deploy.last/farm-service.xml to disable farming
  7. In ${JBOSS_HOME}/server/node1/deploy/tc5-cluster-service.xml and local-service.xml, set CacheMode to REPL_SYNC. We want entity cache replication to be synchronous so our hibernate objects are in a consistent state.
  8. (Optional - is this required?) In ${JBOSS_HOME}/server/node1/deploy/jbossweb-tomcat55.sar/context.xml, set distributable flag to true:
    No Format
    <Context ... distributable="true">
    
  9. Start up LAMS by doing cd ${JBOSS_HOME}/bin; ./run.sh -c node1 -b ${IP_ADDRESS}
    Tip

    Make sure you specify the IP address in order for JBoss' auto discovery to work.

...

No Format
2008-10-08 14:42:18,442 INFO  [DefaultPartition] New cluster view for partition DefaultPartition (id: 1, delta: 1) : [172.20.100.22:1099, 172.20.100.28:1099]
2008-10-08 14:42:24,749 INFO  [TreeCache] viewAccepted(): new members: [172.20.100.22:33451, 172.20.100.28:32821]
2008-10-08 14:42:24,752 INFO  [TreeCache] locking the tree to obtain transient state
2008-10-08 14:42:24,754 INFO  [TreeCache] returning the transient state (140 bytes)

Setup the load balancer

Warning

Note that the jvmRoute define in server.xml must be the same as the worker.nodeX.*

  1. Setup Apache with mod_jk
  2. Edit httpd.conf, add the following with paths modified as required
    No Format
    
    LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
    JkWorkersFile /etc/libapache2-mod-jk/workers.properties
    
  3. Set JkMount in your virtual server:
    No Format
    JkMount /lams* loadbalancer
    
  4. Configure the workers.properties:
    No Format
    worker.list=loadbalancer
    
    worker.node1.port=8009
    worker.node1.host=172.20.100.22
    worker.node1.type=ajp13
    worker.node1.lbfactor=1
    
    worker.node2.port=8009
    worker.node2.host=172.20.100.28
    worker.node2.type=ajp13
    worker.node2.lbfactor=1
    
    worker.loadbalancer.type=lb
    worker.loadbalancer.balance_workers=node1,node2
    worker.loadbalancer.sticky_session=1
    worker.loadbalancer.method=S
    

...

The above classes will probably need to be changed to use jboss cache if we want session replication/failover/fault tolerance.

Cluster start up

To ensure that the cluster starts correctly, it must be started in this sequential order:

  1. Start MySQL
  2. Start JBoss nodes
  3. Start Apache

Make sure that each of these services is fully started before starting the next one.