You can 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.
The ClusterConfigCommands command group for the AdminTask object includes
the following commands:
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.
Target object
None
Parameters and return values
- -clusterConfig
- Specifies the 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)
- -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)
Examples
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]')
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, you
must 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.
Target
object
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, you must 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 and return values
- -clusterName
- The name of the cluster to which the new member will belong. If you do
not specify this parameter, you must specify the cluster object ID in the
command target.
- -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.
- -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, you must 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, you
must 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.
Examples
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]]]')
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]]]')
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.
Target
object
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 and return
values
- -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.
Examples
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.
Target
object
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
and return values
- -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.
- -replicatorEntry
- Specifies the 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.
Examples
Batch mode
example usage:
Using Jacl:
$AdminTask deleteClusterMember {-clusterName cluster1 -memberNode node1 -memberName member1}
$AdminTask deleteClusterMember {-clusterName cluster1 -memberNode node1
-memberName member2 -replicatorEntry {{true}}}
Using Jython string:
AdminTask.deleteClusterMember('[-clusterName cluster1 -memberNode node1
-memberName member1]')
AdminTask.deleteClusterMember('[-clusterName cluster1 -memberNode node1
-memberName member2 -replicatorEntry [[true]]]')
Interactive mode example usage:
Using Jacl:
$AdminTask deleteClusterMember -interactive
Using Jython string:
AdminTask.deleteClusterMember ('[-interactive]')