tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Anderson <ranom...@gmail.com>
Subject Re: jvmRoute with multiple AJP Connectors for one Engine
Date Fri, 21 Dec 2012 01:39:31 GMT
Hi Chris,

It's a very good question. Yes, I'm using stick sessions.

-->server.xml (tomsrv01)

    <Connector port="8009" enableLookups="false" connectionTimeout="20000"
protocol="AJP/1.3" redirectPort="8443" />
    <Connector port="8010" protocol="AJP/1.3" secure="true" scheme="https"
enableLookups="false" connectionTimeout="20000" />

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomsrv01">

--> server.xml (tomsrv02)

    <Connector port="8009" enableLookups="false" connectionTimeout="20000"
protocol="AJP/1.3" redirectPort="8443" />
    <Connector port="8010" protocol="AJP/1.3" secure="true" scheme="https"
enableLookups="false" connectionTimeout="20000" />

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomsrv02">



-->worker.properties

worker.list=balancer,balancersec

worker.tomsrv01.type=ajp13
worker.tomsrv01.host=172.17.1.65
worker.tomsrv01.port=8009
worker.tomsrv01.lbfactor=1
worker.tomsrv01.connection_pool_timeout=20

worker.tomsrv01sec.type=ajp13
worker.tomsrv01sec.host=172.17.1.65
worker.tomsrv01sec.port=8010
worker.tomsrv01sec.route=tomsrv01
worker.tomsrv01sec.lbfactor=1
worker.tomsrv01sec.connection_pool_timeout=20

worker.tomsrv02.type=ajp13
worker.tomsrv02.host=172.17.1.66
worker.tomsrv02.port=8009
worker.tomsrv02.lbfactor=1
worker.tomsrv02.connection_pool_timeout=20

worker.tomsrv02sec.type=ajp13
worker.tomsrv02sec.host=172.17.1.66
worker.tomsrv02sec.port=8010
worker.tomsrv02sec.route=tomsrv02
worker.tomsrv02sec.lbfactor=1
worker.tomsrv02sec.connection_pool_timeout=20

worker.balancer.type=lb
worker.balancer.balance_workers=tomsrv01,tomsrv02
worker.balancer.sticky_session=1

worker.balancersec.type=lb
worker.balancersec.balance_workers=tomsrv01sec,tomsrv02sec
worker.balancersec.sticky_session=1


--> mod_jk.mounts

/app1/* balancer
/app2/* balancer

--> mod_jk_sec.mounts

/app1/* balancersec
/app2/* balancersec


Now, the "trick":



-->httpd.conf

<VirtualHost *:80>
        ...
        Include conf.d/mod_jk.mounts
        ...
</VirtualHost>

<VirtualHost *:443>
        ...
        Include conf.d/mod_jk_sec.mounts
        ...
</VirtualHost>


Regards,

Robert








On Thu, Dec 20, 2012 at 1:59 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Robert,
>
> On 12/19/12 5:48 AM, Robert Anderson wrote:
> > <Connector port="8009" enableLookups="false"
> > connectionTimeout="20000" protocol="AJP/1.3" redirectPort="8443"
> > /> <Connector port="8010" protocol="AJP/1.3" secure="true"
> > scheme="https" enableLookups="false" connectionTimeout="20000" />
> >
> > <Engine name="Catalina" defaultHost="localhost"
> > jvmRoute="*tomsrv02*">
> >
> > worker.properties
> >
> > worker.*tomsrv02*.type=ajp13 worker.*tomsrv02*.host=172.17.1.45
> > worker.*tomsrv02*.port=8009 worker.*tomsrv02*.lbfactor=1
> > worker.*tomsrv02*.connection_pool_timeout=20
> >
> > worker.tomsrv02sec.type=ajp13 worker.tomsrv02sec.host=172.17.1.45
> > worker.tomsrv02sec.port=8010 *worker.tomsrv02sec.route=tomsrv02*
> > worker.tomsrv02sec.lbfactor=1
> > worker.tomsrv02sec.connection_pool_timeout=20
> >
> >
> > We use two connectors to apply separate rules (e.g. firewall,
> > monitoring tools) for each one of them.
>
> How does mod_jk know which worker to use when the session id ends in
> ".tomsrv02"?
>
> Or are you not using sticky sessions?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iEYEAREIAAYFAlDTQ+EACgkQ9CaO5/Lv0PBjQwCeLKfGha/tT6+0M+aM6HcPjIzy
> hdIAnRSamTwZKIwDdFrPkQJRp4Ac9mco
> =pMq+
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message