Home > JAVA > Install Glassfish 2.1.1 with HADB

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.

Start domain

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 [4848] 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.

Create new cluster
For Node Agent choose that we have made.
01_1

Start cluster
03
05

Deploy sample application (clusterjsp)
You can find sampe application on C:\Sun\AppServer\samples\ee-samples\highavailability\apps\clusterjsp\clusterjsp.ear.
06

Run
Open localhost:38081/clusterjsp or localhost:38080/clusterjsp from your browser.
07

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: 4.4.3.21 [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.

Configure  Availability
If we have done create hadbd storage area, in Configurations menu we can see cluster1-config (name of cluster that we have made).
08
09
10
11

Stop and start cluster
12
13

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

 

Reference:
http://www.randombugs.com/java/glassfish/install-glassfish-21-hadb.html

Categories: JAVA Tags: , , ,
  1. No comments yet.
  1. July 15, 2014 at 1:45 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: