TomcatExpert

3 Different Schools of Thought for Managing Production Apache Tomcat Infrastructures

posted by MSacks on March 17, 2010 06:24 AM

There are three schools of thought on how to achieve the same task of managing a large production Tomcat infrastructure: distributed command-line solutions,  custom tools using Java Management Extensions (JMX), and full-blown commercial software suites designed for managing Tomcat specifically.  All of the methods and utilities for managing Tomcat have their own respective tradeoffs of elegance, simplicity, manageability, and cost.

Tomcat Manager Application

The Tomcat Manager application is an excellent utility for managing Tomcat server. It has built-in support for deploying and un-deploying applications, reloading applications, gathering statistics about the JVM and Web application, as well as starting and stopping applications. IT even includes a Web-based JMX proxy where a user can modify and query MBeans through the manager application.

Where it falls short is that it primarily only supports functions for performing management operations at the servlet container level and above. It doesn’t allow a user to restart, start or stop the JVM that the Tomcat instance runs on from this Web interface and doesn’t have a built-in method for managing groups of Tomcat servers.

1) Command Line and Scripted Interfaces

The simplest method is using ssh-keys and shell/Python/Ruby/Groovy scripts, which requires little effort to implement, but lacks in elegance. There are a number of service wrappers that support automatic restarts on failure, schedule restarts and taking thread dumps on failure, but they don’t come with a good interface through being managed remotely by a Java standard such as JMX.

Many institutions implement homegrown or scripted solutions for managing large Tomcat infrastructures. When dealing with anything beyond 10 Tomcat servers, it becomes tedious to log into each host and start and stop each Tomcat instance.

Many solutions exist for running a distributed command against a large group of Tomcat clusters. Some organizations set up SSH keys on all hosts and use a scripted or CGI Web interface to send a single command to a large group of servers; however, when dealing with thousands of hosts, installing the keys can become a tedious task, and without a configuration management utility, such as Puppet or Cfengine this can consume a large amount of time to perform.

Tentakel

Tentakel is a distributed command execution utility, and is primarily used for managing supercomputing clusters. Tentakel is written in Python, and is found in UCSD’s Rocks Clusters Supercomputing Platform.  Tentakel also happens to come in handy for managing large amounts of Tomcat servers.

Tentakel is handy for managing large Tomcat infrastructures because of its ability to group servers together in a single configuration file, and run commands in parallel in groups. Tentakel uses ssh and rsh for it’s execution mechanism, and also requires that to be configured, so again a good configuration management utility or provisioning utility must be utilized in order to install the key on all hosts to be managed, but regardless of implementation some transport mechanism has to be configured on each destination Tomcat server. What is important is how effective and simple that is to perform. Once the transport mechanism is installed, be it ssh, rsh, or a custom agent, there still needs to be a central point of management that is easy to maintain.

I find that Tentakel’s use of a single configuration file for managing groups of Tomcat servers makes this easy to do. It also has a plug-in interface, which can be extended to implement custom commands for making use of the Tomcat management application’s facilities for managing Web applications in a Tomcat container.

For example, if I have two Tomcat clusters, each with 500 servers in each cluster, lets say east and west coast. I can restart all of my Tomcat servers on the West Coast in parallel, by executing a single command, and provided such an action wouldn’t take out my database or data store, then I could manage 500 Tomcat instances with a single command, provided they are all grouped in a single configuration file. Having the ability to manage large amounts of Tomcat servers from a single interface saves time through automation, and saving time in the enterprise is directly related to saving money and efficiency.

2) Custom Tools & JMX

The Catalina MBean comprises of the majority of operations that can be invoked on a Web application running in a Tomcat container, except those for controlling the JVM itself. Tying all of the application management and monitoring pieces together along with controlling large amounts of Tomcat instances is ideal. However it requires using security on JMX, which in my experience many companies do not.

The option to accomplish managing the JVM through JMX is to write a custom MBean for stopping and restarting Tomcat. The only problem is once the JVM goes down, so does the JMX listener, so there isn’t a clear way to start up a Tomcat server via JMX without an agent listener process.

3) Agent Based Models and Commercial Tools

There are a few agent based models for administering Tomcat application servers. Agent based models place a daemon process directly on the Tomcat server that is managed remotely and always listening for control commands such as starting, stopping, and deploying applications. This is an efficient method for managing Tomcat; only a few solutions exist.

Java Service Wrapper, and Yet Another Java Service Wrapper are utilities that allow for daemon-izing your Java processes on a Unix based system, or running it as a service on a Windows system, which gives it additional functionality such as automatic and scheduled restarts and JVM start up option configuration, but they do not have a good facility for securely and remotely restarting the JVM or remotely pushing configurations.

Hyperic HQ and MuleSoft Tcat Server are agent-based solutions with out of the box for managing large Tomcat infrastructures. As long as the agent is installed it can automatically detect running Tomcat instances and manage them from a single Web dashboard or command-line interface out-of-the-box.

The other option is to create an agent that always listens on the machine where the Tomcat server is hosted, and listen on a given port and send commands for invoking and shutting down processes. This still requires deploying a custom agent and creating a management application to keep an inventory of all managed servers.

Conclusions

There are many solutions available for Managing large Tomcat infrastructures available, although only a few that are well designed for both managing Tomcat servers at a process level, as well as managing application deployments. Command line utilities are the simple, cost-efficient and require the least amount of tooling time to start managing large Tomcat infrastructures. They are not elegant, but with tools like Tentakel, there is a central configuration point that keeps a level of sanity to effectively manage large Tomcat infrastructures.

There are some service wrappers for Java processes that allow for daemon-izing or turning a Java process into a configurable service. These service wrappers add a nice additional layer of control to the process of the Tomcat server, but don’t have well-developed facilities for managing servers remotely. This is something that must be built on top of these services or purchased.

Depending on the needs for managing a large Tomcat implementation, I have presented a solution from the very basic and effective, to the more elegant and thorough methods. Most users will find that some combination of all methods suits their needs. Some readers will want to go with a commercial solution if time and support is more of an issue than cost.

More Resources

Matthew Sacks is an Application System Administrator at Edmunds.com, and focuses on administering, monitoring and managing high-volume, high-traffic production Web sites. He is also the Founder and Editor of TheBitsource.com, a blog on System Administration, Web Application Development and Software Engineering. He is an active member in the USENIX The Advanced Computing Systems Professional and Technical Association, and has contributed to such publications as Linux Pro Magazine, Sys Admin Magazine, and InformIT.

Comments

Thanks

Thanks for sharing!

You’re right, auto restarts

You’re right, auto restarts don’t look god most of the time. And yes, it is hard to terminate each instance with a login. I have found Tentakel to be useful in many scenarios, because I manage a horde of Tomcat servers.

non reflective glass

In the past years more and

In the past years more and more people have started to use the Tomcat applications for daily activities or for business purposes. The effects of using it are very rewarding. Many people would place the business phone systems Houston in the same category, as they managed to expand their business faster than expected.

cmx videomxf

Software avchd converter convert avchd video files to avi, mp4, wmv, mov mod converter free download to convert HD camcorder files. mts to avi mp4 mov mkv iMovie, FCP/FCE with mts converter, so to convert mts files for your PC and mobiles. sd

David

boom beach tipps It is especially decent, though look into the tips during this home address. coc gratis juwelen

I think it is not a simple

I think it is not a simple job to manage the production. There are many difficulties to face. The idea is very good. Try hard and achieve the goal. All the best for your venture! Thank you very much for sharing this post here! dish network channel list

Great post. I'm going through

Great post. I'm going through some of these issues as well..
Mortgage Broker Calgary

Nice post. I learn something

Nice post. I learn something totally new and challenging on websites I stumbleupon every day. It's always helpful to read through content from other authors and use something from their sites.
Edmonton Mortgage Broker
Life Insurance Vancouver
Life Insurance Calgary

David

buy twitter followers Your texts on this subject are correct, see how I wrote this site is really very good. twitter retweet

I think it is little bit

I think it is little bit tough to manage such a situation. But it is very necessary to handle that situation in the proper way. The three schools of thought are really effective and also we can manage the production easily. back and neck pain relief

This post shares an

This post shares an informative post and I think most of the users know that it is really hard to overcome such situation. The three different thoughts for managing production Apache Tomcat infrastructures that have been shared on this blog are really useful! kosher restaurants la

I am a regular viewer of this

I am a regular viewer of this site. I can see many useful articles in this site. Thanks for sharing about the three different schools of thought for managing production Apache Tomcat Infrastructures. Expecting more blogs like this from you which are very useful to us. 4D Global

Very informative page

Very informative page contains the different articles about Apache Tomcat. Here in this article you have provided the details of 3 Different Schools of Thought for Managing Production Apache Tomcat Infrastructures. All the three methods are very informative. Keep updating. sell miles

I use only high quality

I use only high quality materials - you can see them at: Language of Desire Course

great

Very interesting information subscriptions, worth recommending. However, I recommend this: youtube viewer

it's really nice and meanful.

it's really nice and meanful. it's really cool blog. Linking is very useful thing.you have really helped lots of people who visit blog and provide them usefull information. http://theultimateherpesprotocolscam.com

Make the most of mainly

Make the most of mainly premium substances - you will find him or her for: http://doggydansonlinedogtrainerreview.strikingly.com/

On this subject internet

On this subject internet page, you'll see my best information, be sure to look over this level of detail. plus500 forex broker review

This is very significant, and

This is very significant, and yet necessary towards just click this unique backlink: http://tailopez67stepsreview.strikingly.com

Hmm… I interpret blogs on a

Hmm… I interpret blogs on a analogous issue, however i never visited your blog. I added it to populars also i’ll be your faithful primer. locksmith hallandale

Whoever has seen deeply into

Whoever has seen deeply into the world has doubtless divined what wisdom there is in the fact that men are superficial. It is their preservative instinct which teaches them to be flighty, lightsome, and false. Here and there one finds a rolex submariner passionate and exaggerated adoration of "pure forms" in philosophers as well as in artists: it is not to be doubted that whoever has NEED of the cult of the superficial to that extent, has at one time or another made an unlucky dive BENEATH it. Perhaps there is even an order of rank with respect to those burnt children, the born artists who find the enjoyment of life only in trying to FALSIFY its image rolex datejust (as if taking wearisome revenge on it), one might guess to what degree life has disgusted them, by the extent to which they wish to see its image falsified, attenuated, ultrified, and deified,—one might reckon the homines religiosi among the artists, as their HIGHEST rank.

It is the profound, suspicious fear of an incurable pessimism which compels whole centuries breitling to fasten their teeth into a religious interpretation of existence: the fear of the instinct which divines that truth might be attained TOO soon, before man has become strong enough, hard enough, artist enough.... Piety, the "Life in God," regarded in this light, would appear as the most elaborate and ultimate product of the FEAR of truth, as artist-adoration and artist-intoxication in presence of the most logical of all falsifications, as the will to the inversion of truth, to untruth at any price. Perhaps there has hitherto been no more effective means of beautifying man than piety, by means of it man can oyster perpetual air-king become so artful, so superficial, so iridescent, and so good, that his appearance no longer offends.

To love mankind FOR GOD'S SAKE—this has so far been the noblest and remotest sentiment to which mankind has attained. That love to mankind, without any redeeming intention in the background, is only an ADDITIONAL folly and brutishness, that replica burberry handbags the inclination to this love has first to get its proportion, its delicacy, its gram of salt and sprinkling of ambergris from a higher inclination—whoever first perceived and "experienced" this, however his tongue may have stammered as it attempted to express such a delicate matter, let him for all time be holy and respected, as the man who has so far flown highest and gone astray in the finest fashion!00000004

its gram of salt and

its gram of salt and sprinkling of ambergris from a higher inclination—whoever first perceived and "experienced" this,192.168.1.1 192.168.1.1 192.168.0.1 attorney 192.168.1.1 mm to inches inche to cm however his tongue may have stammered as it attempted to express such a delicate matter, let him for all time be holy and respected, as the man who has so far flown highest and gone astray in the finest fashion!

Informative Article

I have gone through your post and came to know about the three different thoughts for managing production Apache Tomcat infrastructures. I think this information will be helpful to all those who are using tomcat server. Expecting more useful blogs like this. caregiver

essays I was very

essays
I was very interested in the article. It’s quite inspiring I should admit.

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.