Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Load balancing / HA with Apache HTTP server and JBoss AS 7 |
|
Author |
|
AkshayLokur
Joined: 22 Nov 2013 Posts: 1 Location: India
|
Posted: Fri 22 Nov '13 9:04 Post subject: Load balancing / HA with Apache HTTP server and JBoss AS 7 |
|
|
Hi,
I am tried to integrate Apache HTTP server and JBoss app server 7 with mod_jk module plugin in Apache.
I have two instances of Jboss running and Apache server sends requests to them.
I have added following code in "httpd.conf" of Apache:
Code: |
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
JkWorkersFile "D:/Program Files/Apache Group/Apache2/conf/workers.properties"
JkShmFile "D:/Program Files/Apache Group/Apache2/logs/mod_jk.shm"
JkLogFile "D:/Program Files/Apache Group/Apache2/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /MyWebApp/* balance1
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyPass / http://localhost:8082/
ProxyPassReverse / http://localhost:8082/
|
And following code in "workers.properties" in Apache:
Code: |
# The load balancer worker balance1 will distribute
# load to the members worker1 and worker2
worker.list=balance1, worker1, worker2
worker.balance1.type=lb
worker.balance1.balance_workers=worker1, worker2
# Define 1 real worker using ajp13
#worker.list=worker1, worker2
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8080
# Define preferred failover node for worker1
worker.worker1.redirect=worker2
# Define 2'nd real worker using ajp13
#worker.list=worker2
# Set properties for worker2 (ajp13)
worker.worker2.type=ajp13
worker.worker2.host=localhost
worker.worker2.port=8082
|
But, though I have configured this way, when my worker1 goes down,Apache is not sending requests to worker2 and I get "Service Temporarily Unavailable" message.
Please suggest if I am missing anything in my configuration here?
Thanks,
Akshay |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7355 Location: Germany, Next to Hamburg
|
Posted: Sun 24 Nov '13 20:02 Post subject: |
|
|
IIRC there is ping_mode that could do the trick.
You may also read http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
I use mod_proxy_ajp for that which has its own advantages and disadvanges over mod_jk. Advantage for me: it is easier to configure
if you still have a question please ask again. |
|
Back to top |
|
|
|
|
|
|