dev@glassfish.java.net

SGES v2.1 patch 03: JMX Connector and Client Hostname ... information needed for debugging purpose

From: <vincent.konieczek_at_mpsa.com>
Date: Tue, 08 Sep 2009 16:44:58 +0200

Hello,


I am looking for information about the JMX connectors used in GlassFish and
the way they are used.

In fact, I am interested in a very specific case.
I have one domain (IP1), one node agent (IP2) and two instances (IP3 and
IP4) to illustrate a bit.
IP1, IP2, IP3 and IP4 are all different IP addresses.

With such a setup, the domain, the node agent and the two instances can
start and every applications deployed on the instances as well.
Unfortunately when we take a look at the instances status through the admin
console, we can observe that most of them are inconsistent (indicated as
Stopped whereas they are running).
An instance whose status is consistent have an IP address that can be
resolved to the IP address of the node agent (IP2).

Through several tests, we have observed that the port configured in the
Admin Service JMX Connector "system" was correctly opened for listening on
the right IP address.
On the other side, we have found several "Connection refused" messages in
the logs that lead us to consider the class
com.sun.enterprise.config.serverbeans.ServerHelper and the method
getJMXConnectorInfo(ConfigContext configContext, String instanceName).
In that method, we can find this :
            //Take the client connection properties from the node agent
referenced by the
            //given server instance. In other words, the host, user,
password used to connect to the
            //server instance should be identical to the host, user,
password used to connect to the
            //server's node agent.
            final JmxConnector agentConnector = NodeAgentHelper.
getNodeAgentSystemConnector(
                configContext, server.getNodeAgentRef());
            hostProp = agentConnector.getElementPropertyByName(
HOST_PROPERTY_NAME);

When a JMX connector is needed to connect to the admin service of an
instance, the hostname used to connect is the hostname of the node agent,
instead of the hostname of the instance.

We have made a very small patch to modify that behaviour and force the use
the hostname of the instance in that specific case.
After putting this patch in the appropriate classpath-prefix and after a
fresh start of GlassFish, we have observed that the inconsistencies of the
statuses reported through the admin console have disappeared.
The admin console or GlassFish seem to work correctly. We have not
identified problems due to this change (everything that was working still
works).
(We have also added log messages to identify the execution paths involved
by this patch and possible impacts on those paths, and found none).

I would be interested to know a bit more about the reasons behind the
comment included.
So if any one has this information or any information related, I would
kindly appreciate if it could share it with us.

Why does such a restriction (to connect to the instance through the node
agent host name) exist ?
And what could be the impacts (or kind of impacts) due to such a change in
that behaviour ?

Is this a behaviour modification that could be integrated as-is in
GlassFish or would it need to consider some configuration parameters
addition to be introduced ?
If this could lead to a patch for further integration in GlassFish, what
would be the requirements ?



About the very small patch ...
We have replaced this line
            hostProp = agentConnector.getElementPropertyByName(
HOST_PROPERTY_NAME);
by the following one in the small extract above.
            hostProp = connector.getElementPropertyByName(
HOST_PROPERTY_NAME);


Thanks in advance for any help on this.




Best Regards


Vincent KONIECZEK