ClusterConfigCommands (AdminTask)
We can use the Jython or Jacl scripting languages to cluster application servers, generic servers, and proxy servers . The commands and parameters in the ClusterConfigCommands group can be used to create and delete server clusters and servers known as cluster members.
The ClusterConfigCommands (AdminTask) includes the following commands:
- (zos) changeClusterShortName
- createCluster
- createClusterMember
- deleteCluster
- deleteClusterMember
- updateClusterMemberWeights
(zos) changeClusterShortName
The createCluster command changes the short name that is associated with the cluster.
Target object None
Steps
- -clusterName ( required)
- Name of the server cluster. (String)
- -shortName (Optional)
- New short name to associate with the cluster. Every cluster must have a unique short name. If this parameter is not specified, a unique short name is automatically assigned. The value specified for this parameter must be 8 characters or less in length and all of the characters must be in uppercase.
Examples
Batch mode example:
Jacl:
$AdminTask changeClusterShortName {-clusterName cluster1 -shortName newshortname}
- Jython string...
AdminTask.changeClusterShortName('[-clusterName mycluster -shortName newshortname]')
- Jython list:
AdminTask.changeClusterShortName(['-clusterName', 'mycluster', '-shortName', 'newshortname'])
Interactive mode:
Jacl:
$AdminTask changeClusterShortName {-interactive}
Jython:
AdminTask.changeClusterShortName ('-interactive')
- Jython list:
AdminTask.changeClusterShortName (['-interactive'])
createCluster
The createCluster command creates a new server cluster. A server cluster consists of a group of 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. We can also use the createCluster command to apply proxy server settings to the cluster.
Target object None
Steps
- -clusterConfig ( required)
- Following configuration information for the new server cluster:
- -clusterName
- Name of the server cluster. (String)
- -preferLocal
- Optionally specifies whether to enable or disable node-scoped routing optimization within the cluster. The default value is false. Specify true to enable node-scoped routing optimization. (Boolean)
Supported configurations: If we enable the preferLocal optimization, the deployment manager must be running to affect the configuration. If the deployment manager is shut down, preferLocal optimization is not performed and requests might be dispersed across all the members of the cluster.
- -clusterType
- Optionally specifies the type of the server cluster to create. The default type is APPLICATION_SERVER. Valid values for this parameter include: APPLICATION_SERVER, PROXY_SERVER, and ONDEMAND_ROUTER. (String)
- (zos) -shortName
- Specific short name of the server. Each server should have a specific short name. Value must be 8 uppercase characters or less. If we do not specify a value for the specificShortName parameter, the system generates a unique short name. (String)
- -replicationDomain (Optional)
- The system uses the replication domain properties for HTTP session data replication.
- -createDomain
- Whether to create a replication domain in the cluster configuration. The default value is false. Specify true to create a replication domain in the cluster configuration. (Boolean)
- -convertServer (Optional)
- 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. We must also specify the serverName parameter. (String)
- -serverName
- The name of the application server to be converted to the first cluster member. We must also specify the serverNode parameter. (String)
- -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. (Integer)
- -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. (String)
- -replicatorEntry
- Whether to enable HTTP session data replication. The default value is false. Specify true to enable HTTP session data replication. Specify this parameter if the createDomain parameter was set to true in the replicationDomain command step. (String)
- -resourcesScope
- Specifies what to do with server resources after the server is moved into a cluster. Possible values:
- server: Specifies that server resources and cluster resources remain where they are, unchanged.
- cluster: Specifies that server resources are moved to the cluster level. The server scope resources overwrite the cluster scope resources.
- both: The server resources are copied to the cluster scope. The server scope resources overwrite the cluster scope resources. The resources on the server scope remain unchanged.
The default value is cluster.
For transitioning users: The default value for the -resourcesScope parameter has been changed to cluster for Version 8.x. The default value is both in Versions 7 and 6.1.trns
Examples
Batch mode example usage:
Jacl:
$AdminTask createCluster {-clusterConfig {-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER}}
$AdminTask createCluster {-clusterConfig {-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER} -replicationDomain {-createDomain true}}
$AdminTask createCluster {-clusterConfig {-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER} -convertServer {-serverNode node1 -serverName server1}}
Jython string...
AdminTask.createCluster('[-clusterConfig [-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER]]')
AdminTask.createCluster('[-clusterConfig [-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER] -replicationDomain [-createDomain true]]')
AdminTask.createCluster('[-clusterConfig [-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER] -convertServer [-serverNode node1 -serverName server1]]')
Jython list:
AdminTask.createCluster(['-clusterConfig', '[-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER]'])
AdminTask.createCluster(['-clusterConfig', '[-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER]', '-replicationDomain', '[-createDomain true]'])
AdminTask.createCluster(['-clusterConfig', '[-clusterName cluster1 -preferLocal true -clusterType APPLICATION_SERVER]', '-convertServer', '[-serverNode node1 -serverName server1]'])
Interactive mode:
Jacl:
$AdminTask createCluster {-interactive}
Jython:
AdminTask.createCluster ('-interactive')
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.
The first cluster member is used as a template to create subsequent members in the cluster. When creating a first cluster member, the template of the cluster member is stored under the scope of the cluster.
Since a cluster can contain members from nodes that run different versions of the application server, the following conditions apply:
- The system stores one template for each version of the node that is already configured as a cluster member.
- The cluster member template will not exist for a given version of node until a first member is created in any node of the same version. For example, if a cluster contains some V6.1 nodes and some V6.0.x nodes, there will be one cluster member template for the V6.1 node and one cluster member template for the V6.0.x node.
- The following template will be used for members created for a V6.1 node: $WAS_HOME/config/templates/clusters/clusterName/servers/V6.1MemberTemplate.
- The following template will be used for members created for a V6.0.x node: $WAS_HOME/config/templates/clusters/clusterName/servers/V6MemberTemplate.
- When we make a configuration change to members in a cluster, you must make the same configuration change to the template stored in the cluster scope that corresponds.
Target object Optionally specifies the configuration ID of the cluster to which the new member belongs. If we do not specify the configuration ID, specify the clusterName parameter. Use the getid command for the AdminConfig object to get the configuration ID of the cluster of interest.
Required parameters
- -clusterName
- The name of the cluster to which the new member will belong. If we do not specify this parameter, specify the cluster object ID in the command target. (String)
Steps
- -memberConfig ( required)
- Configuration of a new member of the cluster.
- memberNode
- Node on which the system creates the cluster member. (String)
- memberName
- Name of the new cluster member. (String)
- memberWeight
- Optionally specifies the starting weight of the cluster member. (Integer)
- memberUUID
- Optionally specifies the UUID of the cluster member. (String)
- genUniquePorts
- Optionally specifies whether the system 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 default value is true. If we do not want to generate unique port numbers, specify the value as false. (Boolean)
- replicatorEntry
- Optionally specifies whether the system creates a replicator entry for the new cluster member in the cluster 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. We can specify this parameter only if a replication domain has been created for the cluster. (Boolean)
- (zos) specificShortName
- Optionally specifies the specific short name of the server. Each server should have a specific short name. The value of this parameter can not exceed 8 characters, begin with a number, or use lowercase characters. If we do not specify a value for the specificShortName parameter, the system generates a unique short name. (String)
- -firstMember (Optional)
- Specifies additional information required to configure the first member of the cluster.
- templateName
- Optionally specifies The name of an application server template to use when creating the new cluster member. If we specify a template, we cannot specify the templateServerNode and templateServerName parameters to use an existing application server as a template. We are required to specify either the templateName parameter, or the templateServerNode and templateServerName parameters in this step. (String)
- templateServerNode
- Optionally specifies the name of the node with an existing application server to use as the template when creating the new cluster member. If we specify the templateServerNode parameter, you must also specify the templateServerName parameter, and we cannot specify the templateName parameter. We are required to specify either the templateName parameter, or the templateServerNode and templateServerName parameters, in this step. (String)
- templateServerName
- Optionally specifies the name of the existing application server to use as the model when creating the new cluster member. If we specify the templateServerName parameter, you must also specify the templateServerNode parameter, and you cannot specify the templateName parameter. We are required to specify either the templateName parameter, or the templateServerNode and templateServerName parameters, in this command step. (String)
- nodeGroup
- Optionally specifies the name of the node group to which the new cluster member and each additional cluster member belongs. Each cluster member must reside on nodes in the same node group. If specified, it must be one of the node groups which this member node belongs to. If not specified, the system assigns the first node group listed for the member node. (String)
- coreGroup
- Optionally specifies the name of the core group to which the new cluster member and each additional cluster member belongs. Each cluster members must belong to the same core group. If not specified, the system assigns the default core group in the cell. (String)
- resourcesScope
- Specifies what to do with server resources after the server is moved into a cluster. Possible values:
- server: Specifies that server resources and cluster resources remain where they are, unchanged.
- cluster: Specifies that server resources are moved to the cluster level. The server scope resources overwrite the cluster scope resources.
- both: The server resources are copied to the cluster scope. The server scope resources overwrite the cluster scope resources. The resources on the server scope remain unchanged.
The default value is both.
Examples
Batch mode example usage:
Jacl:
First member creation using template name:
$AdminTask createClusterMember {-clusterName cluster1 -memberConfig {-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false}} -firstmember {-templateName serverTemplateName}}First member creation using server and node for template:
$AdminTask createClusterMember {-clusterName cluster1 -memberConfig {-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false} -firstmember {-templateServerNode node1 -templateServerName server1}}
Second member creation:
$AdminTask createClusterMember {-clusterName cluster1 -memberConfig {-memberNode node1 -memberName member2 -genUniquePorts true -replicatorEntry false}}
Jython string...
First member creation using template name:
AdminTask.createClusterMember('[-clusterName cluster1 -memberConfig [-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false]] -firstMember [-templateName serverTemplateName]]')
First member creation using server and node for template:
AdminTask.createClusterMember('[-clusterName cluster1 -memberConfig [-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false]] -firstMember [-templateServerNode node1 -templateServerName server1]]')
Second member creation:
AdminTask.createClusterMember('[-clusterName cluster1 -memberConfig [-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false]]')
Jython list:
First member creation using template name:
AdminTask.createClusterMember(['-clusterName', 'cluster1', '-memberConfig', '[-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false]]', '-firstMember', '[-templateName serverTemplateName]'])
First member creation using server and node for template:
AdminTask.createClusterMember(['-clusterName', 'cluster1', '-memberConfig', '[-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false]', '-firstMember', '[-templateServerNode node1 -templateServerName server1]'])
Second member creation:
AdminTask.createClusterMember(['-clusterName', 'cluster1', '-memberConfig', '[-memberNode node1 -memberName member1 -genUniquePorts true -replicatorEntry false]'])
Interactive mode example usage:
Jacl:
$AdminTask createClusterMember {-interactive}
Jython:
AdminTask.createClusterMember ('-interactive')
deleteCluster
The deleteCluster command deletes the configuration of a server cluster. A server cluster consists of a group of servers that are referred to as cluster members. The system deletes each cluster member for the cluster of interest.Use the deleteClusterMember command to delete the configuration of an individual cluster member.
Target object Optionally specifies the configuration object ID of the cluster to delete. If we do not specify the object ID for the cluster, then specify the clusterName parameter. Use the getid command for the AdminConfig object to get the configuration ID of the cluster.
Required parameters
- -clusterName
- Name of the cluster to delete. If we specify the configuration ID of the cluster, do not specify a value for the clusterName parameter. (String)
Steps
- -replicationDomain (optional step)
- -deleteRepDomain
- Whether to delete the replication domain. The default value is false. Specify true to delete the replication domain. (Boolean)
Examples
Batch mode example usage:
Jacl:
$AdminTask deleteCluster {-clusterName cluster1 }
$AdminTask deleteCluster {-clusterName cluster1 -replicationDomain {-deleteRepDomain true}}
Jython string...
AdminTask.deleteCluster('[-clusterName cluster1]')
AdminTask.deleteCluster('[-clusterName cluster1 -replicationDomain [-deleteRepDomain true]]')
Jython list:
AdminTask.deleteCluster(['-clusterName', 'cluster1'])
AdminTask.deleteCluster(['-clusterName', 'cluster1', '-replicationDomain', '[-deleteRepDomain true]'])
Interactive mode:
Jacl:
$AdminTask deleteCluster -interactive
Jython:
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.
Target object Optionally specifies the configuration object ID of the cluster member to delete. If we do not specify the configuration ID, then specify the clusterName, memberNode and memberName parameters. Use the getid command for the AdminConfig object to get the configuration ID of the cluster.
Required parameters
- -clusterName
- Name of the cluster to which the member of interest belongs. 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. (String)
- -memberNode
- Name of the node to which the cluster member belongs. 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. (String)
- -memberName
- Server name of the member to delete 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. (String)
Steps
- replicatorEntry (Optional)
- 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 the cluster member name from the cluster replication domain. Specify the value as true to delete the replicator entry. The default value is false.
Examples
Batch mode example usage:
Jacl:
$AdminTask deleteClusterMember {-clusterName cluster1 -memberNode node1 -memberName member1}
$AdminTask deleteClusterMember {-clusterName cluster1 -memberNode node1 -memberName member2 -replicatorEntry {-deleteEntry true}}
Jython string...
AdminTask.deleteClusterMember('[-clusterName cluster1 -memberNode node1 -memberName member1]')
AdminTask.deleteClusterMember('[-clusterName cluster1 -memberNode node1 -memberName member2 -replicatorEntry [-deleteEntry true]]')
Jython list:
AdminTask.deleteClusterMember(['-clusterName', 'cluster1', '-memberNode', 'node1', '-memberName', 'member1'])
AdminTask.deleteClusterMember(['-clusterName', 'cluster1', '-memberNode', 'node1', '-memberName', 'member2', '-replicatorEntry', '[-deleteEntry true]'])
Interactive mode:
Jacl:
$AdminTask deleteClusterMember -interactive
Jython:
AdminTask.deleteClusterMember ('-interactive')
updateClusterMemberWeights
The updateClusterMemberWeights command updates the weights of the specified cluster members. A cluster member is an application server that belongs to a server cluster.Use the updateClusterMemberWeights command to update the weights of the specified cluster members in the configuration of a cluster.
Target object Configuration object ID of the server cluster to update.
Required parameters
- -clusterName
- Name of the cluster to which the member of interest belongs. 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. (String)
- -memberNode
- Name of the node to which the cluster member belongs. 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. (String)
- -memberName
- Server name of the member to delete 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. (String)
Steps
- 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. (Integer)
Examples
Batch mode example usage:
Jacl:
$AdminTask updateClusterMemberWeights {-clusterName cluster1 -memberNode node1 -memberName member1 -memberWeight integer}
Jython string...
AdminTask.updateClusterMemberWeights('[-clusterName cluster1 -memberNode node1 -memberName member1 -memberWeight integer]')
Jython list:
AdminTask.updateClusterMemberWeights(['-clusterName', 'cluster1', '-memberNode', 'node1', '-memberName', 'member1', '-memberWeight', 'integer'])
Interactive mode:
Jacl:
$AdminTask updateClusterMemberWeights -interactive
Jython:
AdminTask.updateClusterMemberWeights ('-interactive')
Related tasks
Automating application configurations Create cluster members Create a proxy server cluster using wsadmin Use the wsadmin scripting AdminTask object for scripted administration
Cluster configuration scripts Commands (AdminTask)