• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

Load Balancing in JBoss

Configure Load Balancing in JBoss

Use run.sh -b <ip> to run instances on different IPs but same ports

Define it in workers.properties:

worker.jboss2.type=ajp13

worker.jboss2.host=192.168.1.180

worker.jboss2.port=8009

Define a new load balancing worker:

worker.jboss.type=lb

worker.jboss.balance_workers=jboss1,jboss2

Export the load balancing worker:

worker.list=jboss,jkstatus

The updated <apache-dir>/conf/workers.properties looks something like:

worker.jboss1.type=ajp13

worker.jboss1.host=127.0.0.1

worker.jboss1.port=8009

worker.jboss2.type=ajp13

worker.jboss2.host=192.168.1.180

worker.jboss2.port=8009

worker.jboss.type=lb

worker.jboss.balance_workers=jboss1,jboss2

worker.jkstatus.type=status

worker.list=jboss,jkstatus

Deploy session-test.war to both instances, and update SessionTest.jsp on the second so that its page heading and bgcolor are different (e.g. Server 2, lime)

Change/add in conf/jk.conf:

JkMount  /jmx-console  jboss

JkMount  /jmx-console/*  jboss

JkMount  /session-test  jboss

JkMount  /session-test/* jboss

Interested in mastering JBOSS?
Check out this blog post to learn more JBOSS Tutorials.

Start both JBoss instances (on local and public IPs) and restart Apache HTTPD

Test http://localhost/session-test/

The updated <apache-dir>/conf/jk.conf looks something like:

LoadModule    jk_module  <path_to_modules>/mod_jk.so

JkWorkersFile <path_to_conf>/workers.properties

JkLogFile     <path_to_logs>/jk.log

JkLogLevel    info

JkMount       /jmx-console jboss

JkMount       /jmx-console/* jboss

JkMount       /session-test jboss

JkMount       /session-test/* jboss

JkMount       /jkstatus jkstatus

Observe that we are no longer JkMount-ing jboss1 (or jboss2). We can only use the new load balancer worker called jboss because that is the one exported by worker.list inconf/worker.properties.

What happens to “Session Counter” when accessed through http://localhost/session-test/? How about when you access the session-test/ directly, but going tohttp://localhost:8080/session-test/?

For indepth understanding on JBoss click on:

Summary
Review Date
Reviewed Item
Load Balancing in JBoss
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on Load Balancing in JBoss"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.