Sun GlassFish Enterprise Server v2.1.1 Quick Start Guide

Creating a Cluster that Spans Multiple Machines

ProcedureTo Create a Cluster With Instances On Different Machines

The following procedure demonstrates how to create a cluster that has two instances, instance3 and instance4, each running on different machines. The two machines are called schumi and sr115. schumi is the machine that is denoted as the administrative node and is called the Domain Administration Server (DAS).

Before You Begin

You must have already installed Enterprise Server on both machines.

  1. Create and start a node agent (nodeagent2) on the DAS machine.

    Use the following command: asadmin create-node-agent --user admin --host schumi nodeagent2

  2. Start the node agent on the DAS machine.

    Use the following command: asadmin start-node-agent --user admin --host schumi nodeagent2. For more information, see start-node-agent(1) command.

  3. Create a start a node agent on another machine.

    This example uses a second machine called sr115. On the second machine, at the invoke the asadmin utility and use the following command: asadmin create-node-agent --user admin --host schumi nodeagent3


    Note –

    You need to provide the DAS machine name in the --host option.


  4. Start the node agent on the second machine.

    Use the following command: asadmin start-node-agent --user admin --host schumi nodeagent3. For more information, see start-node-agent(1) command.

  5. Log in to the Admin Console of the DAS machine at http:// das-machine-name:portnumber.

    You can see that the two node agents are running if you click Node Agents on the left-hand tree on the Admin Console.

  6. On the left pane, click the Clusters tab and click New.

  7. Specify a name for the cluster.

    This example creates a cluster with the name, mycluster.

  8. In the Server Instances to be Created section, click New.

  9. Type the instance name as instance3 and choose node agent, nodeagent3.

    nodeagent3 was created on the machine called sr115 in step 2 of this procedure.

  10. Type the instance name as instance4 and choose node agent, nodeagent2.

    nodeagent2 was created on the DAS machine called schumi in step 1 of this procedure.

  11. Click OK.

    The cluster gets created.

  12. In the left pane, click Clusters.

  13. In the right pane, select the checkbox next to mycluster and click the Start Cluster button,

    The cluster and the two instances start.

    The two instances in mycluster are running on different machines and are controlled by different node agents. You can view the two node agents and see each instance associated with it.

    If you deploy an application on mycluster, the application is accessible from two machines.