users@glassfish.java.net

Running multiple GF domains on the same server

From: <glassfish_at_javadesktop.org>
Date: Mon, 15 Sep 2008 06:56:16 PDT

Hello,

We try to run multiple gfv2ur1 domains on the same server machine.
The domains run in their own JVM, configured to use virtual IP addresses to prevent network port conflicts (so we don't have to configure ports on each domain, only the (virtual) IP address of the instance).

We can start the domains and most services seem to work correctly (we can deploy applications, etc.). However, the JMX service seems to always use "localhost" although we configured an IP address in the domain.xml:

<jmx-connector accept-all="false" address="x.y.z.w" auth-realm-name="admin-realm" enabled="true" name="system" port="8687" protocol="rmi_jrmp" security-enabled="false">

First, JMX seems to startup correctly:

   Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
   [service:jmx:rmi:///jndi/rmi://x.y.z.w:8687/jmxrmi] for domain management purposes.

but later a "com.sun.appserv.server.ServerLifecycleException" is thrown:

com.sun.appserv.server.ServerLifecycleException: Cannot bind to URL [rmi://servername:8687/management/rmi-jmx-connector]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: servername ...

This means we must disable JMX in each GF instance to get them to run in parallel.

We found in the GF sources the following method which always uses "localhost" instead of the configured IP address:

   JmxServiceUrlFactory.java (v2ur2-b04)
   static String localhost() throws RuntimeException {
           String h;
           try {
               h = java.net.InetAddress.getLocalHost().getCanonicalHostName();
           }
           catch (java.net.UnknownHostException e) {
               h = "localhost";
           }
           return ( h );
       }

This seems to be a bug.
Or do you have a workaround for enabling JMX on all instances?

Thanks for your help in advance!
Best regards:
Norbi
[Message sent by forum member 'snorbicet' (snorbicet)]

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