You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Glenn Nielsen <gl...@mail.more.net> on 2005/05/02 17:52:28 UTC

mod_jk configure failover

Now that local worker is gone from mod_jk how can you configure
two app servers where you want one to be the primary and the
second one to be used for automatic failover only if the primary
is in an error state?

I tried setting lbfactor=1 on the primary and lbfactor=0 on the
failover worker but mod_jk sets lbfactor=1 if you configure a
value <1.

Thanks,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: mod_jk configure failover

Posted by Peter Rossbach <pr...@objektpark.de>.
Hey Glenn,

yes, disabled means, only that no new sessions send to a worker, but 
request with
JSESSIONID send to the worker and
stopped means, no more requests send to a worker.

Peter

Glenn Nielsen schrieb:

>On Mon, May 02, 2005 at 06:17:50PM +0200, Mladen Turk wrote:
>  
>
>>Glenn Nielsen wrote:
>>    
>>
>>>Now that local worker is gone from mod_jk how can you configure
>>>two app servers where you want one to be the primary and the
>>>second one to be used for automatic failover only if the primary
>>>is in an error state?
>>>      
>>>
>>Use 'disabled' flag for standby worker with 'redirect' to that worker.
>>
>>worker.w1.disabled=False
>>worker.w1.redirect=w2
>>
>>worker.w2.disabled=True
>>
>>
>>You can even redirect to the 'domain' or group of workers.
>>    
>>
>
>Thanks.
>
>This seems to be a roundabout way to setup failover on error
>and confuses what disabled=true means.
>
>So let me get this straight, please correct me if I am wrong.
>As of 1.2.11:
>
>If disabled=true for a worker that worker can still receive
>requests if:
>  a) Another real worker has redirect={disabled worker}
>  b) A request has a JSESSIONID with the disabled worker jvmroute
>
>If you really want to disable a worker completely you need to use
>the new stopped=True property?
>
>Regards,
>
>Glenn
>
>----------------------------------------------------------------------
>Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
>MOREnet System Programming               |  * if iz ina coment.      |
>Missouri Research and Education Network  |  */                       |
>----------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: mod_jk configure failover

Posted by Glenn Nielsen <gl...@mail.more.net>.
On Mon, May 02, 2005 at 06:17:50PM +0200, Mladen Turk wrote:
> Glenn Nielsen wrote:
> >Now that local worker is gone from mod_jk how can you configure
> >two app servers where you want one to be the primary and the
> >second one to be used for automatic failover only if the primary
> >is in an error state?
> 
> Use 'disabled' flag for standby worker with 'redirect' to that worker.
> 
> worker.w1.disabled=False
> worker.w1.redirect=w2
> 
> worker.w2.disabled=True
> 
> 
> You can even redirect to the 'domain' or group of workers.

Thanks.

This seems to be a roundabout way to setup failover on error
and confuses what disabled=true means.

So let me get this straight, please correct me if I am wrong.
As of 1.2.11:

If disabled=true for a worker that worker can still receive
requests if:
  a) Another real worker has redirect={disabled worker}
  b) A request has a JSESSIONID with the disabled worker jvmroute

If you really want to disable a worker completely you need to use
the new stopped=True property?

Regards,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: mod_jk configure failover

Posted by Mladen Turk <mt...@apache.org>.
Glenn Nielsen wrote:
> Now that local worker is gone from mod_jk how can you configure
> two app servers where you want one to be the primary and the
> second one to be used for automatic failover only if the primary
> is in an error state?

Use 'disabled' flag for standby worker with 'redirect' to that worker.

worker.w1.disabled=False
worker.w1.redirect=w2

worker.w2.disabled=True


You can even redirect to the 'domain' or group of workers.


Regards,
Mladen.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: mod_jk configure failover

Posted by Peter Rossbach <pr...@objektpark.de>.
Hey Glenn,

a hot standby is very easy. You confgure your nodes inside a 
loadbalancer and
then disabled some nodes. Very best is, you can configure this with the new
lb status worker.

Example:

<IfModule !mod_jk.c>
    LoadModule jk_module modules/mod_jk.so
</IfModule>
JkWorkerProperty worker.list=loadbalancer,jkstatus
JkWorkerProperty worker.node01.type=ajp13
JkWorkerProperty worker.node01.port=7201
JkWorkerProperty worker.node01.host=localhost
JkWorkerProperty worker.node01.cachesize=150
JkWorkerProperty worker.node01.cache_timeout=600

JkWorkerProperty worker.node02.type=ajp13
JkWorkerProperty worker.node02.port=7202
JkWorkerProperty worker.node02.host=localhost
JkWorkerProperty worker.node02.cachesize=150
JkWorkerProperty worker.node02.cache_timeout=600
JkWorkerProperty worker.node02.disabled=false

JkWorkerProperty worker.loadbalancer.type=lb
JkWorkerProperty worker.loadbalancer.balance_workers=node01,node02

JkWorkerProperty worker.jkstatus.type=status

JkLogFile logs/mod_jk.log
JkLogLevel info
# unix only
JkShmMem logs/mod_jk.shm

JkMountFile "conf/uriworkermap.properties"
JkMount /jkstatus jkstatus


At mod_jk 1.2.11 exists also a stopped flag to setup a cold standby.

s.
http://jakarta.apache.org/tomcat/connectors-doc/config/workers.html

regards
Peter

Glenn Nielsen schrieb:

>Now that local worker is gone from mod_jk how can you configure
>two app servers where you want one to be the primary and the
>second one to be used for automatic failover only if the primary
>is in an error state?
>
>I tried setting lbfactor=1 on the primary and lbfactor=0 on the
>failover worker but mod_jk sets lbfactor=1 if you configure a
>value <1.
>
>Thanks,
>
>Glenn
>
>----------------------------------------------------------------------
>Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
>MOREnet System Programming               |  * if iz ina coment.      |
>Missouri Research and Education Network  |  */                       |
>----------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>
>
>  
>





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org