admin@glassfish.java.net

install-node

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Wed, 15 Sep 2010 09:56:55 -0500

  Rajiv,
Nice to see the install-node checkin. I'd like to understand the
expected usage patterns for this.

It seems that the arguments to install-node are very similar to those
for create-node-ssh, except for the way that the hostname is passed in,
with install-node being able to take multiple hosts.

Is the expectation that one would run install-node first on a set of
servers, and then run create-node-ssh? Could create-node-ssh have an
additional argument that would do the install?

Also, it seems that all of the hosts to be installed by a single
install-node command need to use the same sshuser or keyfile, right? I
suppose that in a real production environment, that is probably a good
assumption.

I also am wondering about whether the install can be multi-threaded.


Here's where I'm coming from with the large cluster testing I've been
doing.

I have a file, hosted-nodes, that contains the sshuser and hostname for
each host.
I use a shell function, "install_hosted_nodes" that has the following:

install_hosted_nodes() {
   echo Installing GlassFish on nodes from hosted_nodes file...
   egrep -v '^#' $TESTHOME/hosted-nodes |
     awk '{print $1 "@" $2}' |
     xargs -L 1 -i -t -P0 ssh -n -T {} "rm -rf /scratch/gf/glassfishv3;
unzip -q -d /scratch/gf $GFNIGHTLY"
}

where $GFNIGHTLY is the NFS location of the glassfish.zip file. The -P0
option on xargs causes all of the installed to be run in parallel.

Then I use the following function to create the SSH nodes:

create_hosted_nodes() {
   echo Creating SSH nodes from the hosted_nodes file for domain $DOMAIN...
   grep -v '^#' $TESTHOME/hosted-nodes |
     awk '{ printf "create-node-ssh --nodehost %s --installdir
/scratch/gf/glassfishv3/glassfish --sshuser %s n-ssh-%s-%d\n", $2, $1,
ENVIRON["DOMAIN"], ++n }' |
     asadmin
   asadmin list-nodes
}

I'm trying to figure out how to work the use of install-node into this.
One option would be to run install-node from the xargs in
install_hosted_nodes, but this has the problem that the ZIP file would
be created once for each node, and there would be a problem in that
multiple install-node commands cannot proceed in parallel because they
would all try to use the same glassfish.zip file.

Another option would be to create a single invocation of install-node
that would target all hosts. However, my hosts have different sshusers,
so that would not work. And I would still not get a multi-threaded install.

Thoughts?
Thanks.
Tom