Home » Bugs, Clustering, Debian, Glassfish, Java, Linux

Cluster for Glassfish 2.1

29 January 2009 6 Comments

Again some problems with glassfish cluster. If in Glassfish v2UR2 all was ok in Glassfish 2.1 we had some problems. This post is based on How to install and configure a Glassfish cluster
my early article. So first part of installing the cluster, first server with DAS and all the stuff is working perfectly, but second part when we need to add more instances we get some problems. Following the steps to add a new instance on the cluster we get an error:

asadmin start-node-agent –syncinstances=true ws-agent-2
Please enter the master password [Enter to accept the default]:>
Redirecting output to /home/randombugs/glassfish/nodeagents/ws-agent-2/agent/logs/server.log
Redirecting application output to /home/randombugs/glassfish/nodeagents/ws-agent-2/agent/logs/server.log
com.sun.enterprise.config.ConfigException: Error refreshing ConfigContext:/home/randombugs/glassfish/nodeagents/ws-agent-2/ws-instance-2/config/domain.xml
cause: /home/randombugs/glassfish/nodeagents/ws-agent-2/ws-instance-2/config/domain.xml (No such file or directory)
at com.sun.enterprise.config.impl.ConfigContextImpl.refresh(ConfigContextImpl.java:411)
at com.sun.enterprise.config.impl.ConfigContextImpl.refresh(ConfigContextImpl.java:493)
at com.sun.enterprise.config.impl.ConfigContextImpl.getRootConfigBean(ConfigContextImpl.java:284)
at com.sun.enterprise.config.serverbeans.ServerBeansFactory.getDomainBean(ServerBeansFactory.java:89)
at com.sun.enterprise.config.serverbeans.ConfigAPIHelper.getDomainConfigBean(ConfigAPIHelper.java:75)
at com.sun.enterprise.admin.servermgmt.launch.ASLauncher.buildInternalCommand(ASLauncher.java:767)
at com.sun.enterprise.admin.servermgmt.launch.ASLauncher.buildCommand(ASLauncher.java:726)
at com.sun.enterprise.admin.servermgmt.launch.ASLauncher.process(ASLauncher.java:430)
at com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstanceAllJava(PEInstancesManager.java:287)
at com.sun.enterprise.admin.servermgmt.pe.PEInstancesManager.startInstance(PEInstancesManager.java:162)
at com.sun.enterprise.ee.admin.servermgmt.EEInstancesManager.startInstance(EEInstancesManager.java:228)
at com.sun.enterprise.ee.nodeagent.ProcessInstanceInternal.startInstance(ProcessInstanceInternal.java:83)
at com.sun.enterprise.ee.nodeagent.ProcessManager.startProcess(ProcessManager.java:117)
at com.sun.enterprise.ee.nodeagent.NodeAgent.startInstance(NodeAgent.java:819)
at com.sun.enterprise.ee.nodeagent.NodeAgent$StartServerTask.run(NodeAgent.java:1995)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: /home/randombugs/glassfish/nodeagents/ws-agent-2/ws-instance-2/config/domain.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)
at java.io.FileInputStream.(FileInputStream.java:66)
at com.sun.enterprise.config.impl.ConfigContextImpl.refresh(ConfigContextImpl.java:386)
… 15 more

Looking in logs I found the connection to DAS server was failed and was failed because is trying to connect to localhost !!! Because the DAS server is not on localhost and is on node0 I tried to see how can I solve this. So I found in nodeagents/ws-agent-1/agent/config/das.properties the DAS server variable agent.das.host = localhost. I modified this variable to node0 (my DAS server) and I just start the node agent again. After that all worked perfectly.

I don’t know if the problem came from some misconfiguration or is a real BUG, but I really read the documents from SUN about glassfish cluster and I tried to do the exact steps from there and I got the same error.

Later I observed the das.properties is overwrite (with the bad one) every time when I run start-node-agent with syncinstances=true. So I try to see where can I modify this das property globaly. After some search I just changed in domain.xml from nodeagents/youragent/config this line

<admin-service system-jmx-connector-name=”system” type=”das-and-server”>
&lt;!– The JSR 160 “system-jmx-connector” –&gt;
<jmx-connector accept-all=”false” address=”0.0.0.0″ auth-realm-name=”admin-realm” enabled=”true” name=”system” port=”8686″ protocol=”rmi_jrmp” security-enabled=”false”>
<ssl cert-nickname=”s1as” client-auth-enabled=”false” ssl2-enabled=”false” ssl3-enabled=”true” tls-enabled=”true” tls-rollback-enabled=”true”/>
<property name=”client-hostname” value=”localhost”/>

with

<admin-service system-jmx-connector-name=”system” type=”das-and-server”>
&lt;!– The JSR 160 “system-jmx-connector” –&gt;
<jmx-connector accept-all=”false” address=”0.0.0.0″ auth-realm-name=”admin-realm” enabled=”true” name=”system” port=”8686″ protocol=”rmi_jrmp” security-enabled=”false”>
<ssl cert-nickname=”s1as” client-auth-enabled=”false” ssl2-enabled=”false” ssl3-enabled=”true” tls-enabled=”true” tls-rollback-enabled=”true”/>
<property name=”client-hostname” value=”node0″/>

and all worked ok !

Or the most easy way:

1. Modify domain.xml from domains/domain1/config/ on your das server
2. Restart the domain on das server
3. Delete your instance and node agent from your second node
4. Recreate the node and instance …

and it should work.

Good luck!


6 Comments »

  • bandoswuu qiye, Jr. said:

    the Glassfish is really to manage, I love jboss.

  • Pablo Nóbrega said:

    Very Good.
    It was very useful for me.
    Thanks.

  • Nasif said:

    Hi,
    Nice document.

    i have one doubt, ip’s you are using is static network ip’s(ie configured under a LAN) or two different network IP’s

  • admin (author) said:

    I made both configurations. Do you had any problem ?

    Regards

  • wright said:

    great, it works. thx.

  • marc said:

    love and kisses. thanks.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.