users@glassfish.java.net

Re: clustering basics

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Wed, 18 Apr 2012 15:21:00 -0700

The asadmin not being found is expected, as the software has not yet
been installed on the remote host. Before copying the file over, there
is a check to see if the software is already there.

The NPE is coming from a 15 line section of the code that scans through
a list of files, removing those that should not be copied.
If the command got through that section, you would see a message saying
"Final number of files to be copied..."

Based on a review of the code, I see a bug that could be what you are
seeing. If you have a plain file (not a directory) in the install root
for the server, then you would get the behavior you are seeing. For
example, I did the following to produce the behavior you are seeing.

mkdir $HOME/test
cd $HOME/test
unzip -q $HOME/glassfish.zip
touch glassfish3/x
glassfish3/bin/asadmin install-node ...

Removing the file "x" from the glassfish3 directory allows the command
to proceed. If there is any plain file in the glassfish3 directory (or
in your case, the /usr/share/glassfish-3.1.2 directory), then the
command gets the NPE.

I filed the following issue for this problem:
http://java.net/jira/browse/GLASSFISH-18645

Tom


On 4/18/2012 2:22 PM, Glenn Holmer wrote:
> On Wed, 2012-04-18 at 14:02 -0700, Tom Mueller wrote:
>> You are running the right command. Generally, the order is:
>> - install DAS
>> - setup-ssh (or do it manually as you have done)
>> - install-node
>> - create-node
>> - create-cluster
>> - create-instance --node ... -cluster ... instance-name
>>
>> The NullPointerException on the install-node should not be happening.
>> Does the server.log file (by default in glassfish/domains/domain1/logs)
>> have the stack trace from the exception?
>>
>> Also, you can try setting AS_DEBUG=true before running the command, i.e.,
>>
>> AS_DEBUG=true asadmin install-node --installdir
>> /usr/share/glassfish-3.1.2 clustertest-node1
>>
>> to get more output.
> Yes, the NPE is what was bothering me. Here's what I get with AS_DEBUG:
>
> glassfish_at_clustertest:~$ AS_DEBUG=true asadmin install-node --installdir /usr/share/glassfish-3.1.2 clustertest-node1
> CLASSPATH= /usr/share/glassfish-3.1.2/glassfish/bin/../modules/admin-cli.jar
> Commands: [install-node, --installdir, /usr/share/glassfish-3.1.2, clustertest-node1]
> asadmin extension directory: /usr/share/glassfish-3.1.2/glassfish/lib/asadmin
> Prepare
> Process program options
> Parsing program options
> Parse command options
> params: {installdir: [/usr/share/glassfish-3.1.2]
> }
> operands: [clustertest-node1]
> Prevalidate command options
> Inject command options
> Validate command options
> Domain XML file = /usr/share/glassfish-3.1.2/glassfish/domains/clustertest/config/domain.xml
> asadmin --host localhost --port 4848 --interactive=true --echo=false --terse=false install-node --sshuser ${user.name} --sshport 22 --installdir /usr/share/glassfish-3.1.2 --create=false --save=false --force=false clustertest-node1
> Execute command
> SSH info is host=clustertest-node1 port=22 user=glassfish password=null keyFile=/home/glassfish/.ssh/id_rsa keyPassPhrase=null authType=null knownHostFile=/home/glassfish/.ssh/known_hosts
> Checking connection...
> Successfully connected to glassfish_at_clustertest-node1 using keyfile /home/glassfish/.ssh/id_rsa
> Specified key file is /home/glassfish/.ssh/id_rsa
> Specified key file exists at /home/glassfish/.ssh/id_rsa
> Running command '/usr/share/glassfish-3.1.2/glassfish/bin/asadmin' version --local --terse on host: clustertest-node1
> Specified key file is /home/glassfish/.ssh/id_rsa
> Specified key file exists at /home/glassfish/.ssh/id_rsa
> clustertest-node1:''/usr/share/glassfish-3.1.2/glassfish/bin/asadmin' version --local --terse' failed [bash: /usr/share/glassfish-3.1.2/glassfish/bin/asadmin: No such file or directory
> ]
> Number of files to be zipped = 5017
> java.lang.NullPointerException
> Command install-node failed.
> glassfish_at_clustertest:~$
>
> And this is what's left behind:
>
> -rw-r--r-- 1 glassfish glassfish 0 2012-04-18 16:11 glassfish3065169330278597855.zip
>
> What does it mean towards the end when he says he can't find asadmin, is
> he looking for it on the node?
>