Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Setup the load balancer

  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
    

...