Sun GlassFish Mobility Platform 1.1 Installation Guide

Chapter 5 Creating A Cluster

This chapter explains how to create a cluster and multiple cluster instances in which the Sun GlassFish Mobility Platform gateway and its components can run.

This chapter contains the following sections:

Starting Your Sun GlassFish Mobility Platform Domain

Start your Sun GlassFish Mobility Platform gateway domain, if that domain hasn't already been started. To see if the gateway domain is running, issue the following command:

asadmin list-domain
mep not running
Command list-domains executed successfully.

If the domain isn't running, start it by executing the following command:

asadmin start-domain sgmpDomainName

Substitute sgmpDomainName with the name of the domain name of your Sun GlassFish Mobility Platform gateway.

Creating A Node Agent

You need to create a node agent but you will not start it at this point.

Node agents are responsible for communications between your domain administration server and server instances or clusters. You create a node agent by executing the asadmin create-node-agent command, as shown, where nodeAgentName is the name of your node agent.

asadmin create-node-agent nodeAgentName
Command create-node-agent executed successfully.

If you don't specify a node agent name, the hostname of your system will be used. If you create a node agent on a different server, you must also specify host and port information for your domain administration server by passing the --host hostname and --port portnumber options to the asadmin command.

Defining A Sun GlassFish Enterprise Server Cluster Configuration

    You can use the Sun GlassFish Enterprise Server Admin Console to set up a cluster by defining a cluster configuration that is shared among multiple instances:

  1. Start the Sun GlassFish Enterprise Server Admin Console.

    1. In a browser window, open http://gateway_hostname:4848.

      The login screen for the Enterprise Server Admin Console appears.

    2. Log in using user admin and password adminpass.

      The Enterprise Server Admin Console appears.

  2. Select Clusters in the navigation tree.

  3. Select New to create a new cluster.

  4. Type a cluster a name.

  5. Select the default configuration.

  6. Add at least 2 new server instances for now.

  7. For each cluster instance, select the node agent that represents the machines where your cluster instances will run.

  8. Press OK.

    The new cluster and its instances are created. This process may take a long time.

Starting Your Node Agent

    After the cluster and its instances have been created, you need to start the node agent:

  1. Issue the following command:

    asadmin start-node-agent nodeAgentName
    
  2. Enter the administrative user name, if prompted:

    Please enter the admin user name>
  3. Enter the administrative password, if prompted:

    Please enter the admin password>
  4. Enter the master password or press the Enter key to accept the default master password:

    Please enter the master password [Enter to accept the default]:>

    You should see the following messages:

    Redirecting output to 
      /nodeagents/nodeAgentName/agent/logs/server.log
    Redirecting application output to 
      /nodeagents/nodeAgentName/agent/logs/ser ver.log
    Command start-node-agent executed successfully.
  5. Start the Sun GlassFish Enterprise Server Admin Console.

  6. Select the Node Agents item in the navigation tree.

    Your node agent should be shown as running. This procedure will also start up your cluster and its cluster instances.

Making the Sun GlassFish Mobility Platform Gateway and Its Components Available to the Cluster Instances

    Complete the following steps to make the Sun GlassFish Mobility Platform gateway, default components, and optional components available to the cluster instances:

  1. Start the Sun GlassFish Enterprise Server Admin Console.

    1. In a browser window, open http://gateway_hostname:4848.

      The login screen for the Enterprise Server Admin Console appears.

    2. Log in using user admin and password adminpass.

      The Enterprise Server Admin Console appears.

  2. Select Enterprise Applications from the navigation tree.

  3. Select gateway-tier-server.

  4. Select the Target tab.

  5. Press the Manage Targets button.

  6. Select your cluster from the available targets choice box and press the Add button.

  7. Press the OK button.

  8. Repeat steps 3 – 7 for the Salesforce, MusicDB, and Siebel connector modules that were configured as part of the default Sun GlassFish Mobility Platform installation:

    • Web Applications->musicdb-ws

    • Web Applications->salesforce-ws

    • Connector Modules->sun-siebeleai-adapter

    • Connector Modules->ds-jcr-connector-jaxrs

    • Connector Modules->ds-jcr-connector-jaxws

    • Connector Modules->ds-jcr-musicdb

    • Connector Modules->ds-jcr-siebel-eway

The following connector modules components are optional. You only need to make the ones that you are using available to the cluster instances:

Making the Sample Resources on the Sun GlassFish Mobility Platform Gateway Available to the Cluster Instances

The resources for the Salesforce.com, MusicDB and Siebel sample applications were added to the gateway during the Sun GlassFish Mobility Platform installation to make the examples without any additional user configuration. Complete the following steps to make these resources available to the cluster instances:

  1. Start the Sun GlassFish Enterprise Server Admin Console.

  2. Select Resources->JDBC->JDBC Resources from the navigation tree.

  3. Select jdbc/gw.

  4. Select the Target tab.

  5. Press the Manage Targets button.

  6. Select your cluster from the available targets choice box and press the Add button.

  7. Press the OK button.

  8. Select the checkbox next to the target name of cluster that was just added and then press the Enable button to enable it on the cluster.

  9. Repeat steps 2–8 for the following resources:

    • Resources->JDBC->JDBC Resources->jdbc/musicdb

    • JMS Resources->Connection Factories->jms/ConnectionFactory

    • JMS Resources->Destination Resources->queue/MontorQueue

    • Connectors->Connector Resources->mep/musicdb

    • Connectors->Connector Resources->mep/siebel

    • Connectors->Connector Resources->mep/sforce

Stopping and Restarting the Cluster

You need to stop and restart your cluster for the new settings to take effect:

  1. Select the cluster in the Sun GlassFish Enterprise Server Admin Console.

  2. Select the checkbox to the left of the cluster name and then press the Stop Cluster button.

  3. Once the cluster has been stopped, select the checkbox to the left of the cluster again and then press the Start Cluster button to restart your cluster.