Loadbalancer-Service
The Loadbalancer-Service provides reverse-proxy support with silent failover.
Configuration
1.Copy the directory loadbalancer.sar to your deploy directory.
2.Edit loadbalancer.sar/META-INF/jboss-service.xml to match your configuration. Here is an example of this file:
jboss.web:service=WebServer
20000
org.jboss.web.loadbalancer.scheduler.RoundRobinScheduler
jboss.web.loadbalancer:service=Scheduler
true
JBoss_LB_ID
http://www1.mysite.org/
1
http://www2.mysite.org/
1
Connection-timeout:
The connection-timeout controls after which time interval a host should be considered dead. This value is given in milliseconds.
Scheduler class name:
The algorithm to use to schedule requests.
Sticky-sessions and sticky session cookie name:
This value (true or false is allowed) controls if a request should always go to the host the client is first scheduled on. This is needed if you use HTTP-sessions in your web-application. If you set this value to false every request is rescheduled with the algorithm given in the scheduler class. The session cookie name sets the name of the cookie the sticky session information is stored in.
Hosts list:
The hosts given in this list are used as request targets. The URLs can be of any type a normal web-browser will accept (http://www.xy.zz/, https://www.xy.zz/, http://www.xy.zz:8080/).
3.Edit loadbalancer.sar/WEB-INF/web.xml to match the JMX-name you gave the MBean. Here is an example of the web.xml:
JBoss reverse proxy
Loadbalancer
org.jboss.web.loadbalancer.LoadbalancerServlet
loadbalancer-service-name
jboss.web.loadbalancer:service=Loadbalancer
1
Loadbalancer
/*