使用脚本编制查询集群状态

可以使用 wsadmin 工具和脚本编制来查询集群状态。

开始之前

开始本任务前,wsadmin 工具必须正在运行。有关更多信息,请参阅“使用 wsadmin 脚本编制来启动 wsadmin 脚本编制客户机”主题。

关于此任务

执行以下步骤查询集群状态:

过程

  1. 标识 Cluster MBean,并将其指定给 cluster 变量。
    • 使用 Jacl:
      set cluster [$AdminControl completeObjectName cell=mycell,type=Cluster,name=cluster1,*]
    • 使用 Jython:
      cluster = AdminControl.completeObjectName('cell=mycell,type=Cluster,name=cluster1,*')
      print cluster
    此命令返回 Cluster MBean。
    示例输出:
    WebSphere:cell=mycell,name=cluster1,mbeanIdentifier=Cluster,type=Cluster,process=cluster1
  2. 查询集群状态。
    • 使用 Jacl:
      $AdminControl getAttribute $cluster state
    • 使用 Jython:
      AdminControl.getAttribute(cluster, 'state')
    此命令返回运行时状态属性的值。

指示主题类型的图标 任务主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_clusterstate
文件名:txml_clusterstate.html