This chapter describes how to create and set up clusters. A cluster is a group of server instances (typically on multiple hosts) that share the same configurations, resources, and applications. A cluster facilitates load balancing across server instances and high availability through failover. You can create clusters spanning multiple machines and manage them with the help of the node agent process on each machine.
This chapter assumes that you are running a domain with cluster profile or enterprise profile. This chapter has the following sections:
This section explains how to create a cluster that contains two Enterprise Server instances, both residing on a single machine.
This procedure creates the sample cluster one the same host on which the DAS is running.
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.
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.
On the left pane, click the Clusters tab.
To create a cluster, do one of the following:
Click cluster1 . The General Information for this cluster appears.
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.
On the right pane, click the Instances tab. Click the New button to create two entries to specify two instances for the cluster.
Type instance1. In the Node Agent field, nodeagent1 is selected by default.
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
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.
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).
You must have already installed Enterprise Server on both machines.
Create and start a node agent (nodeagent2) on the DAS machine.
Use the following command: asadmin create-node-agent --user admin --host schumi nodeagent2
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.
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
You need to provide the DAS machine name in the --host option.
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.
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.
On the left pane, click the Clusters tab and click New.
Specify a name for the cluster.
This example creates a cluster with the name, mycluster.
In the Server Instances to be Created section, click New.
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.
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.
The cluster gets created.
In the left pane, click Clusters.
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.
You can view the ports numbers and override the default values for the clustered server instance you created in the previous section, Creating a Cluster . By default, the HTTP ports are 38081 for instance1 and 38080 for instance2. If these ports were busy on your machine when you created these clusters, or if you had already assigned these ports to other instances and clusters, different port numbers were assigned.
To view the port numbers and optionally override the default values, follow these steps:
In the left pane, expand Clusters and click cluster1 to display the General Information page for clusters.
Click the Instances tab to display instance1 and instance2, the instances that you created.