WebSphere Application Server Network Deployment, Version 6.1
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

             Personalize the table of contents and search results

Creating cluster members using scripting

You can create cluster members using the AdminConfig object and scripting.

Before you begin

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

About this task

The template options are available only for the first cluster member that you create. All cluster members that you create after the first member will be identical.

A template is stored in the cluster scope that you must use to create additional cluster members. For more information about this template, see the Modifying cluster member templates using scripting article.

To create cluster members using the AdminConfig object, perform the following steps:

Procedure

  1. There are two ways to perform this task. Choose one of the following:
    • Using the AdminTask object:
      • Using Jacl:

        $AdminTask createClusterMember {-interactive}
      • Using Jython:
        AdminTask.createClusterMember ('[-interactive]')
    • Using the AdminConfig object:
      1. Identify the existing cluster and assign it to the cluster variable:
        • Using Jacl:

          set cluster [$AdminConfig getid /ServerCluster:myCluster1/]
          
        • Using Jython:
          cluster = AdminConfig.getid('/ServerCluster:myCluster1/')
          print cluster
        Example output:
        myCluster1(cells/mycell/cluster/myCluster1|cluster.xml#ServerCluster_1)
      2. Identify the node to create the new server and assign it to the node variable:
        • Using Jacl:

          set node [$AdminConfig getid /Node:mynode/]
          
        • Using Jython:
          node = AdminConfig.getid('/Node:mynode/')
          print node

        Example output:

        mynode(cells/mycell/nodes/mynode|node.xml#Node_1)
      3. (Optional) Identify the cluster member template and assign it to the serverTemplate variable:
        • Using Jacl:

          set serverTemplate [$AdminConfig listTemplates Server]
        • Using Jython:
          serverTemplate = AdminConfig.listTemplates('Server')
          print serverTemplate
        Example output:
        server1(templates/default/nodes/servers/server1|server.xml#Server_1)
      4. Create the new cluster member, by using the createClusterMember command.
        • The following example creates the new cluster member, passing in the existing cluster configuration ID, existing node configuration ID, and the new member attributes:
          • Using Jacl:

            $AdminConfig createClusterMember $cluster $node {{memberName clusterMember1}}
          • Using Jython:
            AdminConfig.createClusterMember(cluster, node, [['memberName', 'clusterMember1']])
        • The following example creates the new cluster member with a template, passing in the existing cluster configuration ID, existing node configuration ID, the new member attributes, and the template ID:
          • Using Jacl:

            $AdminConfig createClusterMember $cluster $node 
            {{memberName clusterMember1}} $serverTemplate
          • Using Jython:
            print AdminConfig.createClusterMember(cluster, node, 
            [['memberName',  'clusterMember1']], serverTemplate)
          Example output:
          clusterMember1(cells/mycell/clusters/myCluster1|cluster.xml$ClusterMember_2)
  2. Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
  3. In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.



In this information ...


IBM Redbooks, demos, education, and more


Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

IBM Suggests
Task topic    

Terms of Use | Feedback

Last updated: Feb 25, 2009 9:32:38 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/txml_addcluster.html