users@glassfish.java.net

RE: Running multiple GF domains on the same server

From: Manfred Riem <mriem_at_manorrock.org>
Date: Mon, 15 Sep 2008 07:45:48 -0600

If you bind it to the physical IP / hostname and change the port
number for each domain you should be fine.

Whether or not is a bug or a feature I don't know ;)

Manfred

> -----Original Message-----
> From: glassfish_at_javadesktop.org [mailto:glassfish_at_javadesktop.org]
> Sent: Monday, September 15, 2008 7:56 AM
> To: users_at_glassfish.dev.java.net
> Subject: Running multiple GF domains on the same server
>
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net