tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathias.Herbe...@iroise.net
Subject Local worker considerations
Date Mon, 13 May 2002 13:30:32 GMT

I read  Bernd's message and  in the end  I do agree with  the imperial
need for a notion of local  workers, or more exactly for the notion of
non  local  workers,  i.e.   workers  used  exclusively  for  requests
pertaining to a session they created.

I wrote a piece of Apache configuration to handle Tomcat node shutdown,
I have the following code in my config file:

<IfDefine TOMCAT_SHUTDOWN>
RewriteEngine On
RewriteRule ^@LB_URI@$	[F]
</IfDefine>

where @LB_URI@ is the URI the  hardware load balancer checks to see if
the Apache instance is alive and should be used to dispatch requests.

To shut down a node, I issue Apache a graceful restart signal with the
additional parameter -DTOMCAT_SHUTDOWN, from then on the @LB_URI@ will
return a 403 error code and thus the LB will end up excluding the just
gracefully  restarted Apache instance  from its  pool. But  before the
Apache  instance is excluded,  normal requests  dispatched to  it will
continue to be answered correctly, provided @LB_URI@ is not a URI used
by the clients.

Once  the hardware load  balancer excluded  the Apache  instance, wait
until  the Tomcat  instance has  no more  active sessions  (which will
happen provided no  client reactivates its session over  and over, and
provided a mod_jk  instance will not dispatch a request  not part of a
session to a  non local worker). When no active  sessions exist on the
Tomcat  instance, shut  it down.  Deploy the  new webapp  version then
start Tomcat again.  You can test the new webapp  by connecting to the
associated Apache  instance directly  (instead of the  load balancer's
virtual  IP). When  the webapp  is considered  correct, do  a graceful
restart  of your  other Apache  instances using  the -DTOMCAT_SHUTDOWN
option and do a graceful  restart of the first Apache instance without
the -DTOMCAT_SHUTDOWN option.  Your new webapp is now  deployed on the
first  instance and  the other  instances  continue to  serve the  old
version. You can therefore deploy the new version progressively on all
Tomcat instances.

For this  procedure to function  properly we see  that we do  need, as
Bernd pointed out, the notion of  local and non local workers, i.e. we
need to be  able to have workers  kown by a jk instance  but which are
used ONLY for requests part of a session they created.

I  therefore suggest  an additional  parameter be  added for  the load
balancing workers,  namely the last  level of local workers,  i.e. any
worker past this level will be considered non local. The default value
for  this parameter  would  be  the last  level  thus considering  all
workers local.

This  addition should  solve Bernd's  problem (and  even  maybe before
Wednesday ;-).

Mathias.

-- 
--  Credit Mutuel de Bretagne  --  DST / Reseaux et Systemes Distribues
--  32 rue Mirabeau -- Le Relecq-Kerhuon -- 29808 Brest Cedex 9, FRANCE
--  Tel +33298004653 - Fax +33298284005 - Mail: Mathias.Herberts@cmb.fr
--  Key Fingerprint: 8778 D2FD 3B4A 6B33 10AB  F503 63D0 ADAE 9112 03E4

--
Ce message et  toutes les pieces jointes (ci-apres  le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute  utilisation ou  diffusion  non autorisee  est interdite.   Tout
message  etant  susceptible  d'alteration,  l'emetteur  decline  toute
responsabilite au titre de  ce message  s'il a  ete altere, deforme ou
falsifie.
                -----------------------------------
This message and any  attachments (the "message") are confidential and
intended  solely   for  the   addressees.  Any  unauthorised   use  or
dissemination is prohibited. As e-mails are susceptible to alteration,
the issuer shall  not be  liable for  the  message if altered, changed
or falsified.



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


Mime
View raw message