Sun Java System Application Server 9.1 Quick Start Guide

Creating a Cluster

This section explains how to create a cluster that contains two Application Server instances.

ProcedureTo Create a Cluster using the Admin Console

For simplicity, the cluster runs completely within one machine. This procedure creates the sample cluster one the same host on which the DAS is running.

Before You Begin

You must have already started the node agent, as described in To Start 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:// localhost:portnumber if you have not already done so.

    Replace the localhost variable with the name of the system that the Domain Administration Server is running on. Replace portnumber with the port number of the cluster or enterprise domain.

  2. On the right pane, under Common Tasks, click Create New Cluster to display the New Cluster page.

  3. Type cluster1 as the name of the new cluster.

  4. From the drop-down list of available configuration templates, select the default-config configuration and choose Make a copy of the selected Configuration.

  5. Click the New button twice to create two entries to specify two instances for the cluster.

  6. Type instance1 and instance2 as instance names.

    Alternatively, you can specify the name of a node agent that you created and started. To create a node agent and start it, use the asadmin create-node-agent(1) command.

  7. Click OK.

    The Cluster Created Successfully page appears, and cluster1 appears in the tree in the left pane. A copy of the configuration template default-config was made for this cluster, and the name cluster1-config was assigned to it.

  8. Start cluster1 Cluster.

ProcedureTo Create a Cluster using CLI Commands

  1. Create a cluster called cluster1 by running the following asadmin command: asadmin create-cluster --user admin --passwordfile adminpassword.txt --host localhost -port 4848 cluster1

  2. Creates a cluster called cluster1 by running the following asadmin command: asadmin create-cluster --user admin --passwordfile adminpassword.txt --host localhost -port 4848 cluster1

  3. Create a node-agent called cluster1-nodeagent by running the following command: asadmin create-node-agent --user admin --passwordfile adminpassword.txt --host localhost --port 4848 cluster1-nodeagent

  4. Start this node-agent by running the following command: asadmin start-node-agent --user admin --passwordfile adminpassword.txt --host localhost --port 4848 cluster1-nodeagent

  5. Create two instances under the cluster by running the following commands:

    • asadmin create-instance --user admin --passwordfile adminpassword.txt --host localhost -port 4848 --cluster cluster1 --nodeagent cluster1-nodeagent --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 localhost -port 4848 --cluster cluster1 --nodeagent cluster1-nodeagent --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

  6. Start the cluster by running the following command: asadmin start-cluster --user admin --passwordfile adminpassword.txt --host localhost --port 4848 cluster1

    See Chapter 6, Using Application Server Clusters, in Sun Java System Application Server 9.1 High Availability Administration Guide for detailed information on creating and configuring clusters.

    SeeChapter 8, Configuring Node Agents, in Sun Java System Application Server 9.1 High Availability Administration Guide for detailed information on creating and configuring node agents.