The document discusses Glassfish Enterprise Server clustering. It covers installing a node agent on a second machine, creating a cluster with two instances running on different machines, deploying an application to the cluster, testing the clustered application, backing up and restoring the cluster. The key steps are installing node agents on two machines, creating a cluster with instances on each machine, deploying an application, and verifying it can be accessed from both machines. The cluster is then backed up and restored to demonstrate the process.
1. Module-3: Glassfish Enterprise Server Clustering
1
Danairat T.
Line ID: Danairat
FB: Danairat Thanabodithammachari
+668-1559-1446
2. Contents
Module-3: Glassfish Enterprise Server Clustering
• Installing a Server (Node Agent) for the 2nd machine
• Start-Stop Node Agent
• Monitoring Node Agent from Domain Administration Server
• Creating Cluster and Instances
• Reviewing entire start-stop order
• Deploying Application to Cluster
• Testing a Cluster Application
• Back up Cluster
• Test deleting Instances and Cluster and Restore
• Re-Testing access the restored applications
2
3. Glassfish Enterprise Server Clustering Overview
3
The Node Agent:-
A node agent is a lightweight process that
is required on every machine that hosts
server instances, including the machine
that hosts the Domain Administration
Server (DAS). The node agent:
1. Starts, stops, creates and deletes
server instances as instructed by the
Domain Administration Server.
2. Restarts failed server instances.
3. Synchronizes each server instance’s
local configuration repository with the
Domain Administration Server’s
central repository.
The Server Instances and Cluster:-
The Server Instances are assign in a cluster. From
the figure,
1. Server 1 (Instance) and Server 3 (instance) are in
the same Cluster A configuration
2. Server 2 (Instance) and Server 4 (instance) are in
the same Cluster B configuration
4. Glassfish Enterprise Server Clustering Overview
4
From the main installed application server, please see the directory “nodeagents”
In directory “nodeagents”,
there is one directory call “app01”
The new server instance
will be inside here
after you create one.
5. Glassfish Enterprise Server Clustering Overview
5
app 01
- DAS
-Node Agent “app01”
- Instance01
app 02
-Node Agent “app02”
- Instance02
Session replication
Users
request
request
Users
Configuration
Change
The Labs Environment
Labs Steps
• Installing a Server (Node Agent) for
the 2nd machine
• Start-Stop Node Agent
• Monitoring Node Agent from Domain
Administration Server
• Creating Cluster and Instances
• Reviewing entire start-stop order
• Deploying Application to Cluster
• Testing a Cluster Application
• Back up Cluster
• Test deleting Instances and Cluster
and Restore
• Re-Testing access the restored
applications
6. Installing a Server (Node Agent) for the 2nd machine
6
1. Start app01 domain
2. Start app01 node agent
7. Installing a Server (Node Agent) for the 2nd machine
7
3. At the “app02”, Edit hosts file to able to access “app01” and “web01”
4. Run the setup file
8. Installing a Server (Node Agent) for the 2nd machine
8
5. Follow the installer and create installed directory
9. Installing a Server (Node Agent) for the 2nd machine
9
6. Select “Node Agent”, “Command Line Administration Tool Only”, Click Next.
7. Select “Install Java 2 SDK (6.0)
10. Installing a Server (Node Agent) for the 2nd machine
10
8. Enter the DAS password. For this training, it is “password”. The Node Agent name is same as host name.
11. Installing a Server (Node Agent) for the 2nd machine
11
9. Click “Install Now”
12. Start-Stop Node Agent
12
Remark:-
To stop Node Agent, use command:-
asadmin stop-node-agent <nodeagentname>
At “app02” machine, start Node Agent command:-
asadmin start-node-agent app02
The log monitoring
13. Monitoring Node Agent from Domain Administration Server
13
After start the node agent from “app01” and “app02”, you can see the result status from the admin console.
14. Creating Cluster and Server Instances
14
1. Click “New” from the “Cluster” menu
2. Enter name “cluster01” and click “OK”
15. Creating Cluster and Server Instances
15
3. You can now see the new created cluster “cluster01” in the table, click to see details.
16. Creating Cluster and Server Instances
16
4. Create Server Instance for the cluster. Click “Cluster01” -> “Instances” -> “New”
5. Enter name as “instance01”,
select node agent “app01”. Click “OK”
17. Creating Cluster and Server Instances
17
6. Create one more instance name “instance02” for node agent “app02”
7. Enter name as “instance02”, select
node agent “app02”. Click “OK”
18. Creating Cluster and Server Instances
18
8. Select both instances and click “Start”
9. See the server instance status as “Running”
19. Creating Cluster and Server Instances
19
This is a Server Instance Synchronization feature in Glassfish.
Instances in a cluster will keep in the synced both
deployed applications and configurations.
10. In “app01”, you will see the new created directory named “instance01”.
Please also review the same directory in “app02”, The “instance02” will be there.
20. Reviewing entire start-stop order
20
To start servers, 1 Start DAS and Node Agent at machine “app01”
2 Start Node Agent at machine “app02”
21. Reviewing entire start-stop order
21
To stop servers, 1. Stop Node Agent at machine “app02” 2 Stop Node Agent and DAS at machine “app01”
26. Testing a Cluster Application
26
7. Test accessing the application from app01 machine, Success! 8. Test accessing the application from app02 machine, Success!
27. Back up Application Server Cluster
27
1. Stop app01 node agent and DAS
2. Run backup command
29. Test deleting Instances and Cluster and Restore
29
1. Test deleting the “cluster01” from the Admin console
2. The result after delete in the console
30. Test deleting Instances and Cluster and Restore
30
In “app01”, the “instance01” was removed In “app02”, the “instance02” was removed
Removed! Removed!
31. Re-Testing access the restored applications
31
3. Stop app01 node agent and DAS for the restore command working
33. Re-Testing access the restored applications
33
5. Start app01 DAS and node agent.
The instance01 was
came back.
This is the result from
restore process
34. Re-Testing access the restored applications
34
6. Start app02 node agent.
The instance02 was came back.
This is the result from
restore process
35. Re-Testing access the restored applications
35
7. Access to admin console and see the “cluster01”. The two instances are now running.
36. Re-Testing access the restored applications
36
8. Test accessing the application from app01 machine, Success! 9. Test accessing the application from app02 machine, Success!