使用 wsadmin 脚本来启用 WSDM

将 wsadmin 工具与 AdminConfig 对象搭配使用,以在环境中启用 Web Service 分布式管理 (WSDM)。WSDM 是一个经 OASIS 核准的标准,支持通过标准化的 Web Service 接口来管理资源。

关于此任务

WSDM 应用程序安装为系统应用程序且缺省情况下处于已禁用状态。要使用 WSDM 功能,请本主题中的脚本来启用 WSDM。

在多节点环境中,管理代码在由 Java 虚拟机组成的分布式网络上执行,而且在执行过程中,使用一个中央访问点作为整个网络或单元的 Deployment Manager 进程。在 Deployment Manager 上启用 WSDM 以管理单元中的 Java 虚拟机。WSDM 应用程序充当受管应用程序服务器的管理客户机。WSDM 应用程序只能从部署该应用程序的应用程序服务器进行管理。

过程

  1. 启动脚本编制命令。 要了解更多信息,请参阅“启动 wsadmin 脚本编制客户机”信息。
  2. 确定 WSDM 应用程序的配置标识。
    使用 AdminConfig 对象的 getid 选项来检索该配置标识,并将值设为 deployment 变量,如以下示例所示:
    deployment = AdminConfig.getid('/Deployment:WebSphereWSDM/')
  3. 确定 WSDM 配置标识的已部署对象。
    使用 AdminConfig 对象的 showAttribute 选项来检索 deployedObject 属性,并将值设为 deployedObject 变量,如以下示例所示:
    deployedObject = AdminConfig.showAttribute(deployment, 'deployedObject')
  4. 确定 WSDM 已部署对象的目标映射。
    使用 AdminConfig 对象的 showAttribute 选项来检索 targetMappings 属性,并将值设为 targetMappings 变量,如以下示例所示:
    targetMappings = AdminConfig.showAttribute(deployedObject, "targetMappings")
  5. 启用 WSDM。
    将每个映射指定给 target 变量,然后在目标映射中将 enable 属性设为 true,如以下示例所示:
    mappings = targetMappings[1:len(targetMappings)-1].split(" ")
    AdminConfig.modify(target, '[[enable true]]')
  6. 保存配置更改。
    请使用以下命令示例来保存配置更改:
    AdminConfig.save()

示例

以下样本提供 Jython 和 Jacl 脚本,用以在环境中启用 WSDM:
  • 使用 Jython:
    deployment = AdminConfig.getid('/Deployment:WebSphereWSDM/')
    deployedObject = AdminConfig.showAttribute(deployment, 'deployedObject')
    targetMappings = AdminConfig.showAttribute(deployedObject, "targetMappings")
    mappings = targetMappings[1:len(targetMappings)-1].split(" ")
    for target in mappings:
    AdminConfig.modify(target, '[[enable true]]')
    AdminConfig.save()
  • 使用 Jacl:
    set deployment [$AdminConfig getid /Deployment:WebSphereWSDM]
    set deployedObject [$AdminConfig showAttribute $deployment deployedObject]
    set targetMappings [lindex [$AdminConfig showAttribute $deployedObject targetMappings] 0]
    $AdminConfig modify $targetMappings {{enable true}}
    $AdminConfig save

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



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