Starting clusters using scripting

Use the wsadmin tool to start application server, generic server, and proxy server clusters in the application server runtime.

Before you begin

There are multiple ways to complete this task. This topic uses the AdminControl object to start clusters in your environment. Alternatively, you 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.

Procedure

  1. Start the wsadmin scripting tool.
  2. Identify the ClusterMgr MBean and assign it to the clusterMgr variable.
    • Using Jacl:
      set clusterMgr [$AdminControl completeObjectName cell=mycell,type=ClusterMgr,*]
    • Using Jython:
      clusterMgr = AdminControl.completeObjectName('cell=mycell,type=ClusterMgr,*')
      print clusterMgr
    This command returns the ClusterMgr MBean.
    Example output:
    WebSphere:cell=mycell,name=ClusterMgr,mbeanIdentifier=ClusterMgr,
    type=ClusterMgr,process=dmgr
  3. Refresh the list of clusters.
    • Using Jacl:
      $AdminControl invoke $clusterMgr retrieveClusters
    • Using Jython:
      AdminControl.invoke(clusterMgr, 'retrieveClusters')
    This command calls the retrieveClusters operation on the ClusterMgr MBean.
  4. Identify the Cluster MBean and assign it to the cluster variable.
    • Using Jacl:
      set cluster [$AdminControl completeObjectName cell=mycell,type=Cluster,name=cluster1,*]
    • Using Jython:
      cluster = AdminControl.completeObjectName('cell=mycell,type=Cluster,name=cluster1,*')
      print cluster
    This command returns the Cluster MBean.
    Example output:
    WebSphere:cell=mycell,name=cluster1,mbeanIdentifier=Cluster,type=Cluster,process=cluster1
  5. Start or RippleStart the cluster.
    • To start a cluster, use the following example. These commands invoke the start operation on the cluster MBean:
      • Using Jacl:
        $AdminControl invoke $cluster start
      • Using 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 you 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:
      • Using Jacl:
        $AdminControl invoke $cluster rippleStart
      • Using Jython:
        AdminControl.invoke(cluster, 'rippleStart')