Install Glassfish 2.1.1 with HADB
The following article is a note of my activity today play with high availability cluster in Glassfish 2.1.1.
The contents of this article can be use to learn to make HA-cluster in Glassfish 2.1.1 but not intended for production.
Note: when try to install Glassfish using java that came with installer. If you use java with higher versions then you will encounter an error when running the node agent and cluster.
C:\Sun\AppServer\bin>asadmin start-domain Starting Domain domain1, please wait. Default Log location is C:\Sun\AppServer\domains\domain1\logs\server.log. Please enter the admin user name>admin Please enter the admin password> Please enter the master password> Redirecting output to C:/Sun/AppServer/domains/domain1/logs/server.log Domain domain1 started. Domain [domain1] is running [Sun GlassFish Enterprise Server v2.1.1 ((v2.1 Patch06)(9.1_02 Patch12)) (build b31g-fcs)] with its configuration and logs at: [C:\Sun\AppServer\domains]. Admin Console is available at [https://localhost:4848]. Use the same port  for "asadmin" commands. User web applications are available at these URLs: [http://localhost:8080 https://localhost:8181 ]. Following web-contexts are available: [/web1 /__wstx-services ]. Standard JMX Clients (like JConsole) can connect to JMXServiceURL: [service:jmx:rmi:///jndi/rmi://blue-PC:8686/jmxrmi] for domain management purposes. Domain listens on at least following ports for connections: [8080 8181 4848 3700 3820 3920 8686 ]. Domain supports application server clusters and other standalone instances.
Create node agent
C:\Sun\AppServer\bin>asadmin create-node-agent --host localhost --port 4848 nodeagent1 Please enter the admin user name>admin Please enter the admin password> Command create-node-agent executed successfully.
Start node agent
C:\Sun\AppServer\bin>asadmin start-node-agent nodeagent1 Please enter the admin user name>admin Please enter the admin password> Please enter the master password [Enter to accept the default]:> Redirecting output to C:/Sun/AppServer/nodeagents/nodeagent1/agent/logs/server.l og Redirecting application output to C:/Sun/AppServer/nodeagents/nodeagent1/agent/l ogs/server.log Command start-node-agent executed successfully.
Start hadb (if not running)
C:\Sun\AppServer\hadb\4.4.3-21\bin>ma -i ma.cfg ma: Verifying agent configuration: Management Agent version: 188.8.131.52 [V4-4-3-21 2009-05-05 09:45:17 pakker@edeber1 3] (Win_2003ee_ix86) Management Agent log file: C:/Sun/AppServer/hadb/4.4.3-21/log/ma.log ma: Agent configuration verified ma: Service created ma: Service started
Create the HADB stoage area
hadb1 and hadb2 values determined in /etc/hosts
C:\Sun\AppServer\bin>asadmin configure-ha-cluster --hosts hadb1,hadb2 cluster1 Please enter the admin user name>admin Please enter the admin password> Command configure-ha-cluster executed successfully.
Additional hadbm command:
List hadb database
C:\Sun\AppServer\hadb\4.4.3-21\bin>hadbm list Please enter the password for the admin system user:*********** Database cluster1
Check the status of the hadb database.
C:\Sun\AppServer\hadb\4.4.3-21\bin>hadbm status cluster1 Please enter the password for the admin system user:*********** Database Status cluster1 FaultTolerant