Stopping clusters using scripting

 

Stopping clusters using scripting

Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.

Perform the following steps to stop a cluster:

  1. 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
    

  2. Stop the cluster.

    • Using Jacl:
      $AdminControl invoke $cluster stop

    • Using Jython:
      AdminControl.invoke(cluster, 'stop')

    This command invokes the stop operation on the Cluster MBean.




Related concepts
AdminControl object for scripted administration

Related tasks
Starting a cluster using scripting

Related reference
Commands for the AdminControl object