Starting clusters using scripting
Use the wsadmin tool to start application server, generic server, and proxy server clusters in the application server runtime.
There are multiple ways to complete this task. This topic uses the AdminControl object to start clusters in ythe environment. Alternatively, we can use the ClusterConfigCommands command group for the AdminTask object or the startSingleCluster, stopSingleCluster, rippleStartAllClusters, and rippleStartSingleCluster scripts in the AdminClusterManagement script library to administer clusters.
Tasks
- Start the wsadmin scripting tool.
- Identify the ClusterMgr MBean and assign it to the clusterMgr variable.
- Jacl:
set clusterMgr [$AdminControl completeObjectName cell=mycell,type=ClusterMgr,*]- Jython:
clusterMgr = AdminControl.completeObjectName('cell=mycell,type=ClusterMgr,*') print clusterMgrThis command returns the ClusterMgr MBean.
Example output:
WebSphere:cell=mycell,name=ClusterMgr,mbeanIdentifier=ClusterMgr, type=ClusterMgr,process=dmgr- Refresh the list of clusters.
- Jacl:
$AdminControl invoke $clusterMgr retrieveClusters- Jython:
AdminControl.invoke(clusterMgr, 'retrieveClusters')This command calls the retrieveClusters operation on the ClusterMgr Bean.
- Identify the Cluster MBean and assign it to the cluster variable.
- Jacl:
set cluster [$AdminControl completeObjectName cell=mycell,type=Cluster,name=cluster1,*]- Jython:
cluster = AdminControl.completeObjectName('cell=mycell,type=Cluster,name=cluster1,*') print clusterThis command returns the Cluster MBean.
Example output:
WebSphere:cell=mycell,name=cluster1,mbeanIdentifier=Cluster,type=Cluster,process=cluster1- Start or RippleStart the cluster.
- To start a cluster, use the following example. These commands invoke the start operation on the cluster MBean:
- Jacl:
$AdminControl invoke $cluster start- Jython:
AdminControl.invoke(cluster, 'start')
- Use the following example to RippleStart a cluster. RippleStart combines stopping and starting operations. It first stops and then restarts each member of the cluster. For example, your cluster contains 3 cluster members named server_1, server_2 and server_3. When we click RippleStart, server_1 stops and restarts, then server_2 stops and restarts, and finally server_3 stops and restarts. Use the RippleStart option instead of manually stopping and then starting all of the application servers in the cluster. The following commands invoke the rippleStart operation on the cluster MBean:
- Jacl:
$AdminControl invoke $cluster rippleStart- Jython:
AdminControl.invoke(cluster, 'rippleStart')
Starting clusters Create clusters using scripting wsadmin AdminControl Stopping clusters using scripting Cluster administration scripts ClusterConfigCommands Commands for the AdminControl object