dev@glassfish.java.net

cluster setup issues.

From: Harpreet Singh <Harpreet.Singh_at_Sun.COM>
Date: Wed, 13 Sep 2006 14:52:52 -0700

Hi
As promised in an earlier email, here are the issues that I faced
setting up a simple node agent and instance under it.
Forgive a rather long email to make 3 points:
1. masterpassword: default value needs to be exposed in the setup guide
on glassfish. There is no mention of this.
2. Steps/error messages are non-intuitive.
3. We ask a developer to know too much of our internal systems to do
simple things.

I am listing steps/messages that are non-intuitive(to me) in blue.
Here are the steps:
0. java -Xmx256m -jar glassfish-installer-v2-b16.jar

1. glassfish/passfile has u/p: admin/adminadmin.

2. ant -f setup-cluster.xml

3. asadmin start-domain domain1. Asks for admin password, I know from
step1 that it is adminadmin
So far so good, domain starts up.

4. asadmin create-node-agent dhoom.
Asks for admin u/p. Asks for master password. Huh - whats that? I did
not see it in the installation. Ctrl-c.

So I hunt on glassfish.dev.java.net to understand where the
masterpassword is. Eventually I land up at
https://glassfish.dev.java.net/javaee5/build/GlassFish_LB_Cluster.html .
It tells me to download WebServer and show how to configure it or
download samples and run scripts from there. There has to be something
simpler.
 
Some more hunting...Still no idea where to get the masterpassword is.
Maybe I will run the create-node-agent command and try adminadmin.

5. asadmin create-node-agent dhoom. I enter u/p admin/adminadmin,
masterpassword adminadmin . Voila it works!!
I find later that though this creates the node agent but it does not
match the magic masterpassword (changeit).

6. asadmin create-instance --nodeagent dhoom inst1.
Unable to connect to admin-server. Please check if the server is up and
running and that the host and port provided are correct.
What I just created it successfully? Oh - its that thing on the email
alias that said that there is an open issue about 4848 and 4849.
Well I well delete the node-agent and create it again.

7. asadmin delete-node-agent dhoom. Worked
8. asadmin create-node-agent --port 4848 dhoom. Success!
9. asadmin create-instance --nodeagent dhoom inst1.
Unable to connect to admin-server. Please check if the server is up and
running and that the host and port provided are correct.
What ? Oh same issue 4849 - but hey I fixed that in 8.
10. I do 7 again, and vi domain.xml. Node-agent dhoom is present. So the
delete-node-agent just deleted the directory. On snooping around I find
that I need to do delete-node-agent-config. But I did not need to
create-node-agent-config. I presume a do/undo command should work in the
same manner and do/undo/undo-something-more is not intuitive.
Nandini points out to an open issue for this case
http://monaco.sfbay/detail.jsf?cr=6170688. Its open from 2 years and
marked as an RFE. Are there plans to fix this.

11. asadmin delete-node-agent-config dhoom and restart from step 4 again.

12. Step 4 with --port 4848 option and masterpassword adminadmin, Step 6
with --port 4848 works!

13. asadmin start-node-agent dhoom. u/p admin/adminadmin, masterpassword
: adminadmin
Node Agent dhoom failed to startup. Please check the server log for more
details. The log says
[#|2006-09-13T14:11:39.362-0700|SEVERE|sun-appserver-ee9.1|javax.ee.enterprise.system.nodeagent|_ThreadID=10;_ThreadName=main;|NAGT0014:Unexpected
Node Agent exception.
com.sun.appserv.server.ServerLifecycleException:
com.sun.enterprise.ee.admin.servermgmt.AgentException: NSS password is
invalid. Failed to authenticate to PKCS11 slot: internal
        at
com.sun.enterprise.ee.nodeagent.NodeAgentMain.startup(NodeAgentMain.java:172)
        at
com.sun.enterprise.ee.nodeagent.NodeAgentMain.main(NodeAgentMain.java:208)
Caused by: com.sun.enterprise.ee.admin.servermgmt.AgentException: NSS
password is invalid. Failed to authenticate to PKCS11 slot: internal
        at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:576)
        at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:482)
        at
com.sun.enterprise.ee.nodeagent.BaseNodeAgent.run(BaseNodeAgent.java:127)
        at
com.sun.enterprise.ee.nodeagent.NodeAgentMain.startup(NodeAgentMain.java:167)
        ... 1 more
Caused by: com.sun.enterprise.ee.admin.servermgmt.AgentException: NSS
password is invalid. Failed to authenticate to PKCS11 slot: internal
        at
com.sun.enterprise.ee.nodeagent.BaseNodeAgent.init(BaseNodeAgent.java:161)
        at
com.sun.enterprise.ee.nodeagent.NodeAgent.synchronizeWithDASInternal(NodeAgent.java:567)
        ... 4 more
Caused by: java.lang.IllegalStateException: NSS password is invalid.
Failed to authenticate to PKCS11 slot: internal
        at
com.sun.enterprise.ee.security.EESecuritySupportImpl.initNSS(EESecuritySupportImpl.java:135)
        at
com.sun.enterprise.ee.security.EESecuritySupportImpl.<init>(EESecuritySupportImpl.java:101)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at
com.sun.enterprise.pluggable.PluggableFeatureFactoryBaseImpl.invoke(PluggableFeatureFactoryBaseImpl.java:71)
        at $Proxy1.getSecuritySupport(Unknown Source)
        at
com.sun.enterprise.security.SecurityUtil.getSecuritySupport(SecurityUtil.java:354)
        at
com.sun.enterprise.ee.nodeagent.NodeAgent.initializeSecurity(NodeAgent.java:1148)
        at
com.sun.enterprise.ee.nodeagent.NodeAgent.configureAgent(NodeAgent.java:1256)
        at
com.sun.enterprise.ee.nodeagent.BaseNodeAgent.init(BaseNodeAgent.java:154)
        ... 5 more
14. Why? Nandini (thanks a lot!) tells me that masterpassword is set to
"changeit" by default. Oh... I remember something like this from my
previous lifetime when I had to do security tests.
15. Anyways it is not over yet.
16. asadmin delete-node-agent dhoom. I presume it will delete instances
created under it. It does not.
17. asadmin delete-instance inst1. It does not want the node-agent name,
fine I am okay with it.
18. asadmin delete-node-agent-config dhoom
17. I need a coffee ....
18. Starting from step 4 again with masterpassword changeit. Aha
everything worked and started.
<master-card-ad>
    Cluster Created = 1
    Headaches earned = 2
    time spent = 1 day
    understood a new developers pain = priceless :-)
</master-card-ad>
Thanks
Harpreet