users@glassfish.java.net

How can I distinguish server instances in a cluster?

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Jun 2008 10:16:44 PDT

I have some code that need to be 'server instance aware' within a cluster. So I have 2 physical servers, with 2 GlassFish instances per server. In my application, I need to determine which server instance within the cluster it is running in. What are my options?

Can I assign a System property unique on each instance (ie, -Dsvr=MyClusterServer1, -Dsvr=MyClusterServer2, etc)? If so, how? It appears that the system props are assigned globally to the cluster, and not to each instance.

or

Is there an internal (JMX bean or something) name that I can lookup to uniquely distinguish between each server instance within the cluster?

Thanks for any insight/help you might have!

Cheers
[Message sent by forum member 'csiemback' (csiemback)]

http://forums.java.net/jive/thread.jspa?messageID=281076