LISTING 8
target/clockee- 1.0-SNAPSHOT.war
Application deployed with name
clockee- 1.0-SNAPSHOT.
Command deploy executed
successfully.
Web browser to each instance HTTP
connector, as depicted in Figure 2.
We can check that it is running, both
by using asadmin and by pointing our
asadmin list-applications
my-first-cluster
clockee- 1.0-SNAPSHOT <web>
Command list-applications
executed successfully.
Creating a cluster
and deploying a simple
application with so little
effort to a server that
we just downloaded
is already no small
achievement.
You can, of course,
have much more fine-grained control over the
instances of a cluster.
For example, you can
start and stop them
individually, as shown in
Listing 8.
Finally, we can undeploy the application
from the cluster:
asadmin stop-instance local-instance- 1
The instance, local-instance- 1, is stopped.
Command stop-instance executed successfully.
asadmin list-instances - 1
NAME HOST PORT PID CLUSTER STATE
local-instance- 1 localhost 24848 - 1 my-first-cluster not running
local-instance- 2 localhost 24849 16548 my-first-cluster running
Command list-instances executed successfully.
$ asadmin start-instance local-instance- 1
Waiting for local-instance- 1 to start ................
Successfully started the instance: local-instance- 1
instance Location: /usr/local/Cellar/glassfish/3.1/libexec/glassfish/nodes/local-
host-domain1/local-instance- 1
Log File: /usr/local/Cellar/glassfish/3.1/libexec/glassfish/nodes/localhost-do-
main1/local-instance-1/logs/server.log
Admin Port: 24848
Command start-local-instance executed successfully.
The instance, local-instance- 1, was started on host localhost
Command start-instance executed successfully.
$ asadmin list-instances - 1
NAME HOST PORT PID CLUSTER STATE
local-instance- 1 localhost 24848 16846 my-first-cluster running
local-instance- 2 localhost 24849 16548 my-first-cluster running
Command list-instances executed successfully.
JAVA IN ACTION
Figure 2
ABOUT US
See all listings as text
asadmin undeploy
--target=my-first-cluster
clockee- 1.0-SNAPSHOT
Command undeploy
executed successfully.
Figure 3
GlassFish Clustering
Terminology
Now that we have had
an introduction, it is
time to look at the
terminology used for
GlassFish clustering.