tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David kerber <>
Subject Re: Monitoring multiple tomcat instances from single app
Date Tue, 09 Apr 2013 19:46:30 GMT
On 4/9/2013 3:39 PM, Neven Cvetkovic wrote:
> Hey David,
> Just one clarification - I assume TC refers to Apache Tomcat, and not
> "tcat" (mulesoft) or "tc server" (vmware).

Yes, that's correct.  "TC" = "Apache Tomcat"

> You could create a script that uses JMX to connect to each one of the
> instances and polls for certain MBeans that have access to your runtime
> data (your counters). You could even use JMX to modify this runtime data.
> You can use JMX to stop the instances, but not start (because there is
> nothing listening on that port anymore).

Is there a "restart" command available?  Obviously I need to do some 
more research now that you've gotten me started.

> So, what you need to do is write an MBean that will get packaged together
> with your application. When your application is deployed, MBean will
> register automatically with the MBean server (for that Tomcat instance).
> Then in your script you can connect to each one of the instances, search
> for the MBean, and read(write) attributes or invoke operations(methods on
> the MBean). I would probably use some multi-threaded executor (threadpool)
> to call each individual instance.
> Hope that helps.

It does; thanks.

> Neven
> On Tue, Apr 9, 2013 at 3:18 PM, David kerber<>  wrote:
>> My system has several instances of TC 7.0.22, running on windows server
>> 2008 R2, and JRE 6.0.27.  And yes, I know both TC and Java could use an
>> update...
>> The TC instances are all running the same webapp, as a Windows service,
>> though not all have the exact same version of the webapp.  Each is running
>> from its own catalina.base directory, but all have the same catalina.home.
>>   Each instance is listening on a different TCP port, and everything is
>> working fine, handling several hundred requests per second.
>> What I'd like to do is develop an easier way of monitoring each instance
>> than what I have now.  In particular, I'd like to get visibility to a
>> couple of the webapp's internal variables (they're counters), as well as
>> being able to stop and restart the instances if necessary.  My current
>> method is that the app has a browser page that I can log into and see the
>> variables of interest, and I use tomcat7w to control the service instances.
>>   Of course, that requires me to log into each one of them individually to
>> check on them.  That requirement for separate logins is what I'd like to
>> eliminate if possible.
>> Is this even remotely doable from (ideally) another webapp running on the
>> same server, or maybe an external non-browser app?  Or am I just dreaming?
>>   Can JMX allow me to see internal application variables and control
>> services?
>> Thanks for any suggestions!
>> D
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.**<>
>> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message