tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: AW: grab hostname from tomcat manager
Date Wed, 02 Apr 2014 20:32:46 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bjorn,

On 4/2/14, 10:54 AM, Bjoern.Becker@easycash.de wrote:
>> -----Urspr√ľngliche Nachricht----- Von: Andr√© Warnier
>> [mailto:aw@ice-sa.com] Gesendet: Mittwoch, 2. April 2014 16:35 
>> An: Tomcat Users List Betreff: Re: grab hostname from tomcat
>> manager
>> 
>> Bjoern.Becker@easycash.de wrote:
>>> Hello,
>>> 
>>> I need to grab the hostname from the tomcat manager somehow. 
>>> Unfortunately this URL "manager/text/serverinfo" doesn't
>>> contain the
>> hostname.
>>> 
>>> Is there any other smart way to receive the hostname via
>>> tomcat
>> manager app?
>>> 
>> 
>> For give me for asking, but how do you access the tomcat manager
>> if you do not know the hostname ?
> 
> Good question :). But I got a good reason for it.
> 
> I got two servers with several tomcat instances. In front of them
> is a loadbalancer with is configured to do a failover.
> 
> -LB- /               \ Server1:8081 	    Server2:8081
> 
> I need to write a shell script to sync a specific directory and
> for each tomcat instance I need to know on which one the
> loadbalancer is targeting at the moment.

How will you check to see which one the lb is targeting?

> If tomcat 8081 on server 1 is down, the loadbalancer will point to 
> server 2 tomcat 8081. I can find it out through the loadbalancer 
> address only.

You should probably set a jvmRoute in your <Engine> in server.xml.
That way, you can detect which back-end server you are getting just by
looking at the JSESSIONID cookie.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTPHPuAAoJEBzwKT+lPKRYW+oQAKr/BQOhCwBxlA+0cboIWdoO
HLQw8czwuYVqxag9cFiy7XiAUGmnph3pYfZTj6YcYXKDVBEeCuWEVPDFsSuRQG3u
+I9UnWFnoFn8OCWJyv2RKKBfkZ3UhjJom3JmLnHxnWb4KbU9yz/ep5xNpJ43WY3x
VxiPlkdksIKTiwycc6itM+5/URoHn5LzMSAdzb2ZFVhx/VlaubAfqaAo6fIVylTj
TZ0JdZR9QNvL+KO+QPUN5c9j2unVk08oc1feNSyDOdWrs0Fg4e5i6qjORxroA17L
1uEZhnivHL8wvUt89F+oQ+1rqBIff+c242vdvDE7STJK4vUJfSk2JLPIvu/fApfl
NhTgCCM8J7XOIUgCT556RHjioUhCumdzL24PUiIs30DSMYB2/5pC+jarF4+3iXI5
8tAeZR+vVaTaszKYoWjA37dV3WIC+06Us5v2hmmVcuyVxN+IE/hqrxpBkSORcbO4
5PpXJThPHQPvHMwJCywwIxaEDfLuxcWMXD4TJl5cogePt/BRA3p+9xafbuGJvEkN
gaUDSNLXGMTd9iKUHdjH5g5arEPs0tIy5EJVpIcNk1X2QS0nfzH4P7TjrqNj432c
fn3NPUUKn1QdIW6enyc6rgHnF+JHPFCETCtkmbX8lNfqr7rtorpmFXphvrFqcAFa
B43OfQbSyuHsrkfVSoEx
=RiHw
-----END PGP SIGNATURE-----

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


Mime
View raw message