Glassfish JEE Server Administration - Module 4 Load Balancer
1. Module-4: Load Balancer Integration
1
Danairat T.
Line ID: Danairat
FB: Danairat Thanabodithammachari
+668-1559-1446
2. Contents
Module-4: Load Balancer Integration
• Creating HTTP Load Balancer
• Exporting loadbalancer.xml file from Glassfish Enterprise Server
• Installing Web Server and Load Balancer Plug-in
• Importing loadbalancer.xml file to Load Balancer Server
• Testing access Application from Load Balancer
• Reviewing Load Balancer http access log
• Monitoring Application Server Cluster
• Back up the Glassfish Domain, Load Balancer Clients, Clusters
configuration and Deployed Applications
• Reviewing Start All Servers Order
• Test deleting Load Balancer, Cluster, Instances and Restore
• Re-Testing the restored applications
• Reviewing Stop All Servers Order
2
3. The Architecture and Configuration Steps
3
app 01
- DAS
-Node Agent
“app01”
- Instance01
app 02
-Node Agent
“app02”
- Instance02
web 01 Session replication
Users
Load distribution
Load distribution
FirewallFirewall
request
LB Plug-in
Configuration Steps:-
• Creating HTTP Load Balancer
• Exporting loadbalancer.xml file from
Glassfish Enterprise Server
• Installing Web Server and Load
Balancer Plug-in
• Importing loadbalancer.xml file to
Load Balancer Server
• Testing access Application from
Load Balancer
• Reviewing Load Balancer http
access log
• Monitoring Application Server
Cluster
• Back up the Glassfish Domain,
Load Balancer Clients, Clusters
configuration and Deployed
Applications
• Reviewing Start All Servers Order
• Test deleting Load Balancer,
Cluster, Instances and Restore
• Re-Testing the restored applications
• Reviewing Stop All Servers Order
5. Creating HTTP Load Balancer
5
3. Restart the instances by click “stop” -> “start”.
6. Exporting loadbalancer.xml file from Glassfish Enterprise Server
6
Click “Export Now ” from the “Export” tab menu in the “lb01”. Enter the file name as “loadbalance.xml”.
For this training, We will use this file to
import to load balance server (web01) later.
7. Installing Web Server and Load Balancer Plug-in
7
1. At machine “web01”, edit hosts file to be able to access “app01” and “app02”
2. Extract the .gz file to some directory
9. Installing Web Server and Load Balancer Plug-in
9
4. Follow the installation wizard created installed directory and select “custom”.
10. Installing Web Server and Load Balancer Plug-in
10
5. Select “Server Core”, “Administration Command Line”, “Sample Applications”.
6. Select install Java SE Development Kit (JDK) 1.5.0_15.
7. Select “Create an Admin Server,
Web Server Instance”
11. Installing Web Server and Load Balancer Plug-in
11
8. Enter the password. For this training, use “password”.
13. Installing Web Server and Load Balancer Plug-in
13
10. Click “Finish” and review the installed directory.
14. Installing Web Server and Load Balancer Plug-in
14
11. Start Web admin server and instance server.
12. Test access at port 80
15. Installing Web Server and Load Balancer Plug-in
15
13. Monitor access log and error log at /sun/webserver7/https-web01/logs/
16. Installing Web Server and Load Balancer Plug-in
16
1. At web01 machine, start http “admin-server “and stop “https-web01” instance.
Installing The Glassfish Load Balancer Plugin for Sun WebServer
17. Installing Web Server and Load Balancer Plug-in
17
2. Run the setup file (using the same one as set up the Application Server)
18. Installing Web Server and Load Balancer Plug-in
18
3. Follow the installation and Create the installed directory.
19. Installing Web Server and Load Balancer Plug-in
19
4. Select only “Load Balancing Plugin”, “No Administration Tools”
5. Use existing JDK
20. Installing Web Server and Load Balancer Plug-in
20
6. Enter your web instance installed location
7. Enter web server admin’s password.
21. Installing Web Server and Load Balancer Plug-in
21
8. Follow the installation step and click “Finish”.
22. Installing Web Server and Load Balancer Plug-in
22
9. Review the Load Balancer Plugin installed location.
23. Importing loadbalancer.xml file to Load Balancer Server
23
1. Copy “loadbalancer.xml” which export from AppServer to /sun/webserver7/https-web01/config
2. (Re)start web server instance
24. Monitor the Load Balancer Server
24
Monitor the load balance health check status.
29. Testing access Application from Load Balancer
29
5. Test stop the instance which is now service to the user session.
30. Testing access Application from Load Balancer
30
6. Click “Reload Page”
7. The Load Balancer perform “Fail Over” to another machine instance. Success!
The User Session is
maintainable after “Fail Over”
33. Testing access Application from Load Balancer
33
10. Monitor the Load Balancer Health Check at web01 machine /sun/webserver7/https-web01/logs/errors
The LB detected
the app01 is in
unHealthy state
34. Testing access Application from Load Balancer
34
11. Re-test, Click “Reload Page”
12. The Load Balancer performs “Fail Over” from
app01 to “app02”
The User Session is
maintainable after “Fail Over”
35. Testing access Application from Load Balancer
35
13. Start all instances to return the server in normal state.
36. Testing access Application from Load Balancer
36
14. Monitor the Load Balancer Health Check at web01 machine /sun/webserver7/https-web01/logs/errors
The LB detected
that app01 is in
a healthy state
37. Reviewing Load Balancer http access log
37
You can monitor the LB access log at /sun/webserver7/https-web01/logs/access
38. Monitoring Application Server Cluster
38
1. From “cluster01” menu, you can click on each instance to see the status details
39. Monitoring Application Server Cluster
39
2. Review the Log. Testing the “Call Flow” monitoring by click “Enabled” and “Save”
45. Monitoring Application Server Cluster
45
8. The cluster Log configuration is separated from the default “Server” configuration
9. The “Availability Service” is enabled by default
50. Monitoring Application Server Cluster
50
14. The JVM setting is subject to provide the Java Virtual Machine Optimization
51. Back up the Glassfish Domain, Load Balancer Clients, Clusters
configuration and Deployed Applications
51
1. At app01 machine, Stop node agent and DAS then run backup command.
52. Back up the Glassfish Domain, Load Balancer Clients, Clusters
configuration and Deployed Applications
52
2. Review the backup content details
54. Reviewing Start All Servers Order
54
2. At app02, start node agent
3. Start Web Server which is now act as Load Balancer
4. Test access
application via
LB.
55. Test deleting Load Balancer, Cluster, Instances and Restore
55
1. Test deleting Load Balancer configuration 2. Continue deleting the Cluster.
56. Test deleting Load Balancer, Cluster, Instances and Restore
56
3. After delete cluster and Load Balancer from DAS and access application from http://web01,
The application will display “unavailable”
57. Re-Testing the restored applications
57
4. At app01, stop node agent and DAS 5. Restore from backup file
58. Re-Testing the restored applications
58
6. At app01, start DAS and node agent
7. At app02, start node
agent
59. Re-Testing the restored applications
59
8. Login to admin console and review all configuration were came back from the restore
60. Re-Testing the restored applications
60
9. The application is now back to service after done restore. Success
61. Re-Testing the restored applications
61
10. Test add session data to the web application which is located in “app01”
62. Re-Testing the restored applications
62
11. Test stop instance01 which is now service to user session.
63. Re-Testing the restored applications
63
12. The Load Balancer from “web01” detected the “app01” is in unhealthy state.
tail -f /sun/webserver7/https-web01/logs/errors
64. Re-Testing the restored applications
64
13. Click “Refresh Page” 14. Fail Over to “app02”. Success
66. Re-Testing the restored applications
66
16. Monitor the Load Balancer Health Check at web01 machine /sun/webserver7/https-web01/logs/errors
The LB detected
that app01 is in
a healthy state
67. Reviewing Stop All Servers Order
67
1. Stop Web Server 2. Stop node agent and app02 3. Stop node agent and DAS at app01