• Post Reply Bookmark Topic Watch Topic
  • New Topic

manage config files in a cluster  RSS feed

 
L Deng
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to manage a cluster of tomcats or other appservers by JMX to implement the synchronization of config files. Each Tomcat node has a config file for the deployed application with a management web UI. When we update the config file on one node thru the management UI, we want all the config files on the cluster updated.
Can notifications do this?
Any idea would be appreciate.
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might get moved to the Tomcat forum, but its really a general pattern EJB question.

One solution. Set up a singleton on each node that reads the files when the server starts. All reading of the files by all applications modules is done through this singleton. Finally, you want the singleton to periodically check the file for changes using some kind of timeout value so that it does not check to often. If the config file changes, notify the listeners (you can use the java.util.Observable structure for this).

There are many other solutions including always reading the latest version, JNDI stored objects, database objects, and more, but I like the singleton for performance and control of config files.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our cluster loads volatile configuration from a database. We broadcast a "refresh" message that tells all servers in the cluster to clear cached configuration. This felt safer to me than sending updates to the cluster. If a server is down and misses the refresh message, it will still get the right stuff from the database when it comes back up.

There is some 3rd party code (I can blame somebody else) that broadasts changes over JMS as you suggest. I thought it was interesting that the server that makes the value change doesn't really make the value change. It publishes the "change tag x to value y" message and receives it from pub-sub just like every other node in the cluster. I suppose that's standard pub-sub.
 
L Deng
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys to give different answer to solve the problem. But our design must be restricted to JMX structure. Since there's no JMX forum here, would you please move this to Tomcat forum, Moderator? Thank you!

Now my problem seems to be, is that possible for an application to invoke MBean methods of application deployed in a different Tomcat instance? I have refered to http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html and it says "MX4J JSR 160 RMI Adaptor to support JDK 1.4 currently not integrated." What is that mean? Do that mean MX4J JSR 160 RMI Adaptor can't work with Tomcat? And what is "Manage Tomcat with JMX remote Ant Tasks"? Can that be helpful?

Thank you in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!