Sun GlassFish Enterprise Server v2.1.1 Quick Start Guide

Creating a Cluster

This section explains how to create a cluster that contains two Enterprise Server instances, both residing on a single machine.

ProcedureTo Set Up a Cluster with Converged Load Balancer

This procedure creates the sample cluster one the same host on which the DAS is running.

Before You Begin

It is assumed that you have already started the node agent. When you specify instances during cluster creation, associate the instance with a running node agent for the machine on which you want the instance to run. If the node agent is not running, the instance will not start. Node agent and instance names must be unique across clusters that are created in a domain.

  1. Log in to the Administration Console at http:// hostname:portnumber if you have not already done so.

    Replace the hostname variable with the name of the system that the Domain Administration Server is running on. Replace portnumber with the port number of the cluster domain, domain1.

  2. On the left pane, click the Clusters tab.

  3. To create a cluster, do one of the following:

    • On the right-hand pane, click new and type cluster1 as the name. Click OK.

    • Use the following command: asadmin create-cluster --user admin --passwordfile adminpassword.txt --host hostname -port 4848 cluster1

  4. Click cluster1 . The General Information for this cluster appears.


    Note –

    In the General tab on the right hand pane, ensure that the Heartbeat Enabled checkbox is selected. You need GMS service to be running to be able to use the converged load balancer.


  5. On the right pane, click the Instances tab. Click the New button to create two entries to specify two instances for the cluster.

  6. Type instance1. In the Node Agent field, nodeagent1 is selected by default.

  7. Type instance2. In the Node Agent field, nodeagent1 is selected by default. Click Save.

    Instead of steps 4,5, and 6 you can use the following asadmin commands:

    • asadmin create-instance --user admin --passwordfile adminpassword.txt --host hostname -port 4848 --cluster cluster1 --nodeagent nodeagent1 --systemproperties "JMX_SYSTEM_CONNECTOR_PORT=8687:IIOP_LISTENER_PORT=3330:IIOP_SSL_LISTENER_PORT=4440:IIOP_SSL_ MUTUALAUTH_PORT=5550:HTTP_LISTENER_PORT=1110:HTTP_SSL_LISTENER_PORT=2220" instance1

    • asadmin create-instance --user admin --passwordfile adminpassword.txt --host hostname -port 4848 --cluster cluster1 --nodeagent nodeagent1 --systemproperties "JMX_SYSTEM_CONNECTOR_PORT=8688:IIOP_LISTENER_PORT=3331:IIOP_SSL_LISTENER_PORT=4441:IIOP_SSL_ MUTUALAUTH_PORT=5551:HTTP_LISTENER_PORT=1111:HTTP_SSL_LISTENER_PORT=2221" instance2

  8. To start the cluster,

    • Click the General tab and click the Start Cluster button.

    • Start the cluster and its instances by running the following command:

      asadmin start-cluster --user admin --passwordfile adminpassword.txt --host hostname --port 4848 cluster1

    The two instances are started by default when you start the cluster.