You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by weiji <na...@hotmail.com> on 2007/11/13 23:20:30 UTC

[users@httpd] mod_jk load balancing issue: one worker always dies...

Hi,

I'm using mod_jk to load balance two JBoss instances.  However, it seems to
always use only one of them.  

>From watching the status page, I found that the two workers both come up in
an OK state.  However, sending a request through the load balancer seems to
always cause the first one to switch to an error state (ERR), causing the
request to be routed to the second worker (which successfully returns the
requested page).  After the status worker's maintenance countdown, the state
of the first worker switches to ERR/REC and then it never gets itself out of
that state.  At this point, we can still hit both instances of JBoss by
using a direct port to access our webapp.

If I use the reset command on the bad worker, it comes back up as OK/IDLE
but sending a request through the balancer will produce the same behavior.

I thought the two JBoss instances might be interfering with each other, so I
shut down the second JBoss instance and configured mod_jk to use only node1
(set "worker.loadbalancer.balance_workers=node1" only) and restarted Apache,
and the worker still goes into an Error state.

Here are the setup details:
Suse enterprise linux 10
Apache 2.2.0-21.2
mod_jk "1.2.25-httpd-2.2.4"

the workers.properties file:

# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status

# Define Node1
# modify the host as your host IP or DNS name.
# port is the AJP port defined in server.xml
worker.node1.port=8009
worker.node1.host=192.168.4.151
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.cachesize=10

# Define Node2
# modify the host as your host IP or DNS name.
# port is the AJP port defined in server.xml
worker.node2.port=8010
worker.node2.host=192.168.4.151
worker.node2.type=ajp13
worker.node2.lbfactor=1
#worker.node2.cachesize=10

# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1

# Status worker for managing load balancer
worker.status.type=status



Has anyone seen something like this?  Is there a workaround or some
configuration that I need to adjust?

Thanks,
KaJun
-- 
View this message in context: http://www.nabble.com/mod_jk-load-balancing-issue%3A-one-worker-always-dies...-tf4800991.html#a13736022
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_jk load balancing issue: one worker always dies...

Posted by weiji <na...@hotmail.com>.
Update:

I've been double checking various things and I saw that the Apache
documentation recommends to restart the server using a control script, so
I'll use "apachectl -k restart" from now on.

For JBoss to run multiple instances on the same machine, they have a service
binding manager to handle all the various different ports.  I basically
followed the setup available here:
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfiguringMultipleJBossInstancesOnOneMachine
.

I found that the different port options they have by default (named
"ports-01", "ports-02", and "ports-03") use the same AJP port of 8009, so I
thought this was the cause of the problem.  However, setting the entry for
ports-02 to 8010 does not resolve the issue;  rather it now causes both of
the Apache workers to go into an error state... very strange.

Since this seems to be an issue with JBoss, I'll move the issue over to them
and see if they have any insight.

Thanks,
KaJun



weiji wrote:
> 
> Hi John,
> 
> Yes, I do have the JBoss jvmRoute attribute set up correctly.  
> 
> I also noticed the balance vs balanced wording, and I tested my setup with
> both and there seemed to be no difference.  I assume that both wordings
> are correct because node2 can respond to requests with both.  (And after
> any configuration modification, I do restart Apache with "httpd2 -k
> restart".)
> 
> JBoss also had another configuration setting (thank goodness for taking
> notes during setup).  In
> jboss/server/myapp/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml,
> find the attribute 'name="UseJK"', change value from false to true.
> 
> Thanks,
> KaJun
> 
> 
> 
> 
> 
> John Moore-3 wrote:
>> 
>> Do you have the jvmRoute setup in the server.xml in JBoss/Tomcat (e.g.
>> <Engine ... jvmRoute="node1">) ?
>> 
>> you have balance_workers, I think it's balanced_workers
>> 
>> John
>> 
>> -----Original Message-----
>> From: weiji [mailto:nabbleOp@hotmail.com] 
>> Sent: Tuesday, November 13, 2007 2:21 PM
>> To: users@httpd.apache.org
>> Subject: [users@httpd] mod_jk load balancing issue: one worker always
>> dies...
>> 
>> 
>> Hi,
>> 
>> I'm using mod_jk to load balance two JBoss instances.  However, it seems
>> to
>> always use only one of them.  
>> 
>> From watching the status page, I found that the two workers both come up
>> in
>> an OK state.  However, sending a request through the load balancer seems
>> to
>> always cause the first one to switch to an error state (ERR), causing
>> the
>> request to be routed to the second worker (which successfully returns
>> the
>> requested page).  After the status worker's maintenance countdown, the
>> state
>> of the first worker switches to ERR/REC and then it never gets itself
>> out of
>> that state.  At this point, we can still hit both instances of JBoss by
>> using a direct port to access our webapp.
>> 
>> If I use the reset command on the bad worker, it comes back up as
>> OK/IDLE
>> but sending a request through the balancer will produce the same
>> behavior.
>> 
>> I thought the two JBoss instances might be interfering with each other,
>> so I
>> shut down the second JBoss instance and configured mod_jk to use only
>> node1
>> (set "worker.loadbalancer.balance_workers=node1" only) and restarted
>> Apache,
>> and the worker still goes into an Error state.
>> 
>> Here are the setup details:
>> Suse enterprise linux 10
>> Apache 2.2.0-21.2
>> mod_jk "1.2.25-httpd-2.2.4"
>> 
>> the workers.properties file:
>> 
>> # Define list of workers that will be used
>> # for mapping requests
>> worker.list=loadbalancer,status
>> 
>> # Define Node1
>> # modify the host as your host IP or DNS name.
>> # port is the AJP port defined in server.xml
>> worker.node1.port=8009
>> worker.node1.host=192.168.4.151
>> worker.node1.type=ajp13
>> worker.node1.lbfactor=1
>> #worker.node1.cachesize=10
>> 
>> # Define Node2
>> # modify the host as your host IP or DNS name.
>> # port is the AJP port defined in server.xml
>> worker.node2.port=8010
>> worker.node2.host=192.168.4.151
>> worker.node2.type=ajp13
>> worker.node2.lbfactor=1
>> #worker.node2.cachesize=10
>> 
>> # Load-balancing behaviour
>> worker.loadbalancer.type=lb
>> worker.loadbalancer.balance_workers=node1,node2
>> worker.loadbalancer.sticky_session=1
>> 
>> # Status worker for managing load balancer
>> worker.status.type=status
>> 
>> 
>> 
>> Has anyone seen something like this?  Is there a workaround or some
>> configuration that I need to adjust?
>> 
>> Thanks,
>> KaJun
>> -- 
>> View this message in context:
>> http://www.nabble.com/mod_jk-load-balancing-issue%3A-one-worker-always-d
>> ies...-tf4800991.html#a13736022
>> Sent from the Apache HTTP Server - Users mailing list archive at
>> Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-load-balancing-issue%3A-one-worker-always-dies...-tf4800991.html#a13759139
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_jk load balancing issue: one worker always dies...

Posted by weiji <na...@hotmail.com>.
Hi John,

Yes, I do have the JBoss jvmRoute attribute set up correctly.  

I also noticed the balance vs balanced wording, and I tested my setup with
both and there seemed to be no difference.  I assume that both wordings are
correct because node2 can respond to requests with both.  (And after any
configuration modification, I do restart Apache with "httpd2 -k restart".)

JBoss also had another configuration setting (thank goodness for taking
notes during setup).  In
jboss/server/myapp/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml,
find the attribute 'name="UseJK"', change value from false to true.

Thanks,
KaJun





John Moore-3 wrote:
> 
> Do you have the jvmRoute setup in the server.xml in JBoss/Tomcat (e.g.
> <Engine ... jvmRoute="node1">) ?
> 
> you have balance_workers, I think it's balanced_workers
> 
> John
> 
> -----Original Message-----
> From: weiji [mailto:nabbleOp@hotmail.com] 
> Sent: Tuesday, November 13, 2007 2:21 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] mod_jk load balancing issue: one worker always
> dies...
> 
> 
> Hi,
> 
> I'm using mod_jk to load balance two JBoss instances.  However, it seems
> to
> always use only one of them.  
> 
> From watching the status page, I found that the two workers both come up
> in
> an OK state.  However, sending a request through the load balancer seems
> to
> always cause the first one to switch to an error state (ERR), causing
> the
> request to be routed to the second worker (which successfully returns
> the
> requested page).  After the status worker's maintenance countdown, the
> state
> of the first worker switches to ERR/REC and then it never gets itself
> out of
> that state.  At this point, we can still hit both instances of JBoss by
> using a direct port to access our webapp.
> 
> If I use the reset command on the bad worker, it comes back up as
> OK/IDLE
> but sending a request through the balancer will produce the same
> behavior.
> 
> I thought the two JBoss instances might be interfering with each other,
> so I
> shut down the second JBoss instance and configured mod_jk to use only
> node1
> (set "worker.loadbalancer.balance_workers=node1" only) and restarted
> Apache,
> and the worker still goes into an Error state.
> 
> Here are the setup details:
> Suse enterprise linux 10
> Apache 2.2.0-21.2
> mod_jk "1.2.25-httpd-2.2.4"
> 
> the workers.properties file:
> 
> # Define list of workers that will be used
> # for mapping requests
> worker.list=loadbalancer,status
> 
> # Define Node1
> # modify the host as your host IP or DNS name.
> # port is the AJP port defined in server.xml
> worker.node1.port=8009
> worker.node1.host=192.168.4.151
> worker.node1.type=ajp13
> worker.node1.lbfactor=1
> #worker.node1.cachesize=10
> 
> # Define Node2
> # modify the host as your host IP or DNS name.
> # port is the AJP port defined in server.xml
> worker.node2.port=8010
> worker.node2.host=192.168.4.151
> worker.node2.type=ajp13
> worker.node2.lbfactor=1
> #worker.node2.cachesize=10
> 
> # Load-balancing behaviour
> worker.loadbalancer.type=lb
> worker.loadbalancer.balance_workers=node1,node2
> worker.loadbalancer.sticky_session=1
> 
> # Status worker for managing load balancer
> worker.status.type=status
> 
> 
> 
> Has anyone seen something like this?  Is there a workaround or some
> configuration that I need to adjust?
> 
> Thanks,
> KaJun
> -- 
> View this message in context:
> http://www.nabble.com/mod_jk-load-balancing-issue%3A-one-worker-always-d
> ies...-tf4800991.html#a13736022
> Sent from the Apache HTTP Server - Users mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-load-balancing-issue%3A-one-worker-always-dies...-tf4800991.html#a13757377
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_jk load balancing issue: one worker always dies...

Posted by John Moore <Jo...@pdsi-software.com>.
Do you have the jvmRoute setup in the server.xml in JBoss/Tomcat (e.g.
<Engine ... jvmRoute="node1">) ?

you have balance_workers, I think it's balanced_workers

John

-----Original Message-----
From: weiji [mailto:nabbleOp@hotmail.com] 
Sent: Tuesday, November 13, 2007 2:21 PM
To: users@httpd.apache.org
Subject: [users@httpd] mod_jk load balancing issue: one worker always
dies...


Hi,

I'm using mod_jk to load balance two JBoss instances.  However, it seems
to
always use only one of them.  

>From watching the status page, I found that the two workers both come up
in
an OK state.  However, sending a request through the load balancer seems
to
always cause the first one to switch to an error state (ERR), causing
the
request to be routed to the second worker (which successfully returns
the
requested page).  After the status worker's maintenance countdown, the
state
of the first worker switches to ERR/REC and then it never gets itself
out of
that state.  At this point, we can still hit both instances of JBoss by
using a direct port to access our webapp.

If I use the reset command on the bad worker, it comes back up as
OK/IDLE
but sending a request through the balancer will produce the same
behavior.

I thought the two JBoss instances might be interfering with each other,
so I
shut down the second JBoss instance and configured mod_jk to use only
node1
(set "worker.loadbalancer.balance_workers=node1" only) and restarted
Apache,
and the worker still goes into an Error state.

Here are the setup details:
Suse enterprise linux 10
Apache 2.2.0-21.2
mod_jk "1.2.25-httpd-2.2.4"

the workers.properties file:

# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status

# Define Node1
# modify the host as your host IP or DNS name.
# port is the AJP port defined in server.xml
worker.node1.port=8009
worker.node1.host=192.168.4.151
worker.node1.type=ajp13
worker.node1.lbfactor=1
#worker.node1.cachesize=10

# Define Node2
# modify the host as your host IP or DNS name.
# port is the AJP port defined in server.xml
worker.node2.port=8010
worker.node2.host=192.168.4.151
worker.node2.type=ajp13
worker.node2.lbfactor=1
#worker.node2.cachesize=10

# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1

# Status worker for managing load balancer
worker.status.type=status



Has anyone seen something like this?  Is there a workaround or some
configuration that I need to adjust?

Thanks,
KaJun
-- 
View this message in context:
http://www.nabble.com/mod_jk-load-balancing-issue%3A-one-worker-always-d
ies...-tf4800991.html#a13736022
Sent from the Apache HTTP Server - Users mailing list archive at
Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org