Commands for the ClusterConfigCommands group of the AdminTask object

Use the Jython or Jacl scripting languages to cluster servers using scripting. The commands and parameters in the ClusterConfigCommands group can be used to create and delete server clusters and groups of application servers known as cluster members.

For more information about the AdminTask object, see the Commands for the AdminTask object article.

The following commands are available for the ClusterConfigCommands group of the AdminTask object:

Command name: Description: Target object: Parameters and return values: Examples:
createCluster The createCluster command creates a new server cluster. A server cluster consists of a group of application servers that are referred to as cluster members. Optionally, a replication domain can be created for the new cluster, and an existing server can be included as the first cluster member. None

  • Parameters for step one:

    -clusterConfig

    configuration of the new server cluster. This command step is required. The following parameters can be specified for this step:

    clusterName

    The name of the new server cluster. (Required)

    preferLocal

    Enables or disables node scoped routing optimization within this cluster. The value is true or false. It not specified, the default value is true. (Optional)

  • Parameters for step two:

    -replicationDomain

    configuration of a replication domain for this cluster. A replication domain is used to support HTTP session data replication. This command step is optional. The following parameters can be specified for this step:

    createDomain

    Creates a replication domain with a name set to the name of the new cluster. The value is true or false. It not specified, the default value is false. (Optional)

Batch mode example usage:

  • Using Jacl

    $AdminTask createCluster {-clusterConfig {{cluster1 true}}}
    

    $AdminTask createCluster {-clusterConfig {{cluster1 true}} 
    -replicationDomain {{true}}}
    

    $AdminTask createCluster {-clusterConfig {{cluster1 true}} 
    -convertServer {{node1 server1 "" "" ""}}}
    

  • Using Jython string

    AdminTask.createCluster('[-clusterConfig [[cluster1 true]]]')
    
    

    AdminTask.createCluster('[-clusterConfig [[cluster1 true]] 
    -replicationDomain [[true]]]')
    

    AdminTask.createCluster('[-clusterConfig [[cluster1 true]] 
    -convertServer [[node1 server1 "" "" ""]]]')
    

Interactive mode example usage:

  • Using Jacl

    $AdminTask createCluster {-interactive}
    

  • Using Jython string

    AdminTask.createCluster ('[-interactive]')
    

     

  • Parameters for step three:

    -convertServer

    Specifies information about an existing application server to convert to be the first member of the cluster. This command step is optional. The following parameters can be specified for this step:

    serverNode

    The name of the node with the server to be converted to the first cluster member. You must also specify the serverName parameter. (Required)

    serverName

    The name of the application server to be converted to the first cluster member. You must also specify the serverNode parameter. (Required)

    memberWeight

    The weight of the cluster member. The weight controls the amount of work directed to the application server. If the weight is greater than the weight assigned to other cluster members, the server will receive a larger share of the workload. The value is a number between 0 and 100. If none is specified, the default is 2. (Optional)

 
     

nodeGroup

The name of the node group which this cluster member’s node, and all future cluster members’ nodes, must belong to. All cluster members must reside on nodes in the same node group. If specified, it must be one of the node groups which this member’s node belongs to. If not specified, the default value will be the first node group listed for this member’s node. (Optional)

replicatorEntry

Specifies a replicator entry for the converted member will be created in the cluster’s replication domain. A replicator entry is used to provide HTTP session data replication. The value is true or false which indicates whether the replicator entry will be created. The default value is false. You can specify this parameter only if the createDomain parameter was set to true in the replicationDomain command step. (Optional)

  • Returns: The object name of cluster that was created.

 

createClusterMember

The createClusterMember command creates a member of a server cluster. A cluster member is an application server that belongs to a cluster. If this is the first member of the cluster, specify a template to use as the model for the cluster member. The template can be either a default server template, or an existing application server.

cluster Object ID - The configuration object ID of the cluster to which the new member will belong. If you do not specify the configuration ID, specify the clusterName parameter. You can obtain the object name programmatically through Java using the WebSphere Application Server ConfigService API or through wsadmin scripting using the AdminConfig object.

  • Parameters:

    -clusterName

    The name of the cluster to which the new member will belong. If you do not specify this parameter, specify the cluster object ID in the command target.

  • Parameters for step one:

    -memberConfig

    attributes of the new cluster member to be created in the cluster. This command step is required. The following parameters can be specified for this step:

    memberNode

    The name of the node where the new cluster member will be created. This parameter is required.

    memberName

    The name of the server to be created for the new cluster member. This parameter is required.

    memberWeight

    The weight of the new cluster member. This controls the amount of work directed to the application server. If the weight is greater than the weight assigned to other cluster members, the server will receive a larger share of the workload. The value is a number between 0 and 100. The default value is 2.

    memberUUDI

    The universal unique identifier (UUDI) for the new cluster member. (String, optional)

Batch mode example usage:

  • Using Jacl:

    First member creation using template name

    $AdminTask createClusterMember {-clusterName cluster1 
    -memberConfig {{node1 member1 "" "" true false}} 
    -firstmember {{ serverTemplateName "" "" "" ""}}}
    

    First member creation using server and node for template

    $AdminTask createClusterMember {-clusterName cluster1 
    -memberConfig {{node1 member1 "" "" true false}} 
    -firstmember {{ "" node1 server1 "" ""}}}
    

    Second member creation

    $AdminTask createClusterMember {-clusterName cluster1 
    -memberConfig {{node1 member2 "" "" true false}}}
    

  • Using Jython string:

    First member creation using template name

    AdminTask.createClusterMember('[-clusterName cluster1 
    -memberConfig [[node1 member1 "" "" true false]] 
    -firstMember [[serverTemplateName "" "" "" ""]]]')
    

First member creation using server and node for template

AdminTask.createClusterMember('[-clusterName cluster1 
-memberConfig [[node1 member1 "" "" true false]] 
-firstMember [["" node1 server1 "" ""]]]')

Second member creation

AdminTask.createClusterMember('[-clusterName cluster1 
-memberConfig [[node1 member2 "" "" true false]]]')

     

genUniquePorts

Generates unique port numbers for each HTTP transport defined in the server. The new server will not have HTTP transports which conflict with any other servers defined on the same node. The value is true or false. The default value is true .

replicatorEntry

Specifies a replicator entry for the new cluster member will be created in the cluster’s replication domain. A replicator entry is used to provide HTTP session data replication. This command parameter is optional. The value is true or false which indicates whether the entry will be created. The default value is false. You can specify this parameter only if a replication domain has been created for the cluster.

  • Parameters for step two:

    -firstMember

    Specifies additional information necessary to create the first cluster member. This command step is required when creating the first member of the cluster, and is executable only when creating the first member of the cluster. The target of this command step is a Boolean value indicating whether or not to perform this step. The default value is true if any of the step parameters are specified; otherwise the default value is false. The following parameters can be specified for this step:

 
     

templateName

The name of an application server template to use when creating the new cluster member. If you specify a template, you cannot specify the templateServerNode and templateServerName parameters to use an existing application server as a template. You are required to specify either the templateName parameter, or the templateServerNode and templateServerName parameters in this step.

templateServerNode

The name of the node with an existing application server to use as the template when creating the new cluster member. If you specify the templateServerNode parameter, also specify the templateServerName parameter, and you cannot specify the templateName parameter. You are required to specify either the templateName parameter, or the templateServerNode and templateServerName parameters, in this step.

templateServerName

The name of the existing application server to use as the model when creating the new cluster member. If you specify the templateServerName parameter, also specify the templateServerNode parameter, and you cannot specify the templateName parameter. You are required to specify either the templateName parameter, or the templateServerNode and templateServerName parameters, in this command step.

 
     

nodeGroup

The name of the node group which this cluster member’s node, and all future cluster members’ nodes, must belong to. All cluster members must reside on nodes in the same node group. This parameter is optional. If specified, it must be one of the node groups which this member’s node belongs to. If not specified, the default value will be the first node group listed for this member’s node.

coreGroup

The name of the core group this cluster member, and all future cluster members, must belong to. All cluster members must belong to the same core group. This parameter is optional. If not specified, the default value is the default core group defined in the cell.

  • Returns: The object name of cluster member that was created.

 
       

First member creation using server and node for template

AdminTask.createClusterMember
(['-clusterName', 'cluster1', 
'-memberConfig', [['node1', 
'member1', "" "", 'true', 'false']], 
'-firstMember', [["", 'node1', 
'server1', "" ""]]])

Second member creation

AdminTask.createClusterMember
(['-clusterName', 'cluster1', 
'-memberConfig', [['node1', 
'member2', "" "", 'true', 
'false']]])

Interactive mode example usage:

  • Using Jacl

    $AdminTask createClusterMember {-interactive}
    

  • Using Jython string

    AdminTask.createClusterMember ('[-interactive]')
    

deleteCluster The deleteCluster command deletes the configuration of a server cluster. A server cluster consists of a group of application servers that are referred to as cluster members. When a server cluster is deleted, all of its members are deleted.

Use the deleteClusterMember command to delete the configuration of an individual cluster member.

cluster Object ID - The configuration object ID of the cluster to be deleted. If the cluster’s object ID is not specified, then the clusterName parameter must be specified. The object name can be obtained programmatically through Java using the WebSphere ConfigService API, or through wsadmin scripting using the AdminConfig object.

  • Parameters:

    -clusterName

    The name of the cluster to be deleted. If this parameter is not specified, then the cluster object ID must be specified in the command target.

  • Parameters for step one:

    -replicationDomain

    removal of the replication domain for this cluster. This command step is optional. The following parameters can be specified for this step:

    deleteDomain

    Deletes the replication domain for this cluster. This parameter is optional. The value is true or false which indicates whether the domain will be deleted. The default value is false. . Deleting the replication domain deletes all replicator entries defined in the domain.

  • Returns: None

Batch mode example usage:

  • Using Jacl

    $AdminTask deleteCluster {-clusterName cluster1 }
    

    $AdminTask deleteCluster {-clusterName cluster1 -replicationDomain {{true}}}
    

  • Using Jython string

    AdminTask.deleteCluster('[-clusterName cluster1]')
    

    AdminTask.deleteCluster('[-clusterName cluster1 -replicationDomain [[true]]]')
    

Interactive mode example usage:

  • Using Jacl

    $AdminTask deleteCluster -interactive
    

  • Using Jython string

    AdminTask.deleteCluster ('[-interactive]')
    

deleteClusterMember

The deleteClusterMember command deletes the configuration of a cluster member. A cluster member is an application server that belongs to a server cluster.

Use the deleteCluster command to delete the configuration of a cluster.

member Object ID - The configuration object ID of the cluster member to be deleted. If this is not specified, then the clusterName, memberNode and memberName parameters must be specified. The object name can be obtained programmatically via Java using the WebSphere ConfigService API, or via wsadmin scripting using the AdminConfig command.

  • Parameters:

    -clusterName

    The name of the cluster which the member to be deleted belongs to. If this parameter is specified, then the memberName and memberNode parameters must also be specified. If this is not specified, then the member object ID must be specified in the command target.

    -memberName

    The server name of the member to be deleted from the cluster. If this parameter is specified, then the clusterName and memberNode parameters must also be specified. If this is not specified, then the member object ID must be specified in the command target.

    -memberNode

    The name of the node having the cluster member to be deleted. If this parameter is specified, then the memberName and clusterName parameters must also be specified. If this is not specified, then the cluster member object ID must be specified in the command target.

Batch mode example usage:

  • Using Jacl

    $AdminTask deleteClusterMember {-clusterName cluster1 
    -memberNode node1 -memberName member1}
    

    $AdminTask deleteClusterMember {-clusterName cluster1 
    -memberNode node1 -memberName member2 -replicationEntry {{true}}}
    

  • Using Jython string

    AdminTask.deleteClusterMember('[-clusterName cluster1 
    -memberNode node1 -memberName member1]')
    

    AdminTask.deleteClusterMember('[-clusterName cluster1 
    -memberNode node1 -memberName member2 -replicationEntry [[true]]]')
    

Interactive mode example usage:

  • Using Jacl

    $AdminTask deleteClusterMember -interactive
    

  • Using Jython string

    AdminTask.deleteClusterMember ('[-interactive]')
    

     

  • Parameters for step one:

    -replicatorEntry

    removal of a replicator entry for this cluster member. This command step is optional. The following parameters can be specified for this step:

    deleteEntry

    Delete the replicator entry having this cluster member’s name from the cluster’s replication domain. This parameter is optional. The value is true or false which indicates whether to delete the replicator entry. The default value is false.

  • Returns: None

 


Related tasks
Using the AdminTask object for scripted administration Related reference
Commands for the AdminTask object

 



 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.