通过使用 wsadmin 脚本编制来运行 AdminTask 对象的命令

通过 wsadmin 工具,使用 AdminTask 对象来运行管理命令。

当您启动 wsadmin 工具时,动态装入管理命令。您可使用哪些管理命令,以及您可使用他们完成哪些任务,都取决于您所使用的产品的修订版。

通过将 wsadmin 工具与 -conntype NONE 选项配合使用,可以在不运行服务器的情况下启动脚本客户机。AdminTask 管理命令都以连接和本地方式提供。如果服务器当前正在运行,那么建议您不要以本地方式运行 AdminTask 命令,因为以本地方式进行的任何配置更改不会反映在运行的服务器配置中,反之亦然。如果您保存冲突的配置,那么会毁坏配置。

在 Deployment Manager 环境中,仅当脚本编制客户机连接到 Deployment Manager 时才可更新配置。当连接到 Node Agent 或受管应用程序服务器时,您无法更新配置,因为这些服务器进程的配置是位于 Deployment Manager 中的主配置的副本。当在 Deployment Manager 和 Node Agent 之间进行同步配置时,将在节点机器上创建这些副本。通过将脚本编制客户机连接到 Deployment Manager,对服务器进程进行配置更改。要更改配置,不要在节点机器上以本地方式运行脚本客户机,因为该客户机不受支持。

配置说明: 使用 Jacl 脚本语言,subst 命令允许您替换命令中变量的先前设置值。例如:
set nodeparm "node1"
$AdminTask setJVMMaxHeapSize [subst {-serverName server1 -nodeName $nodeparm -maximumHeapSize 100}]
以下 AdminTask 命令可用,但他们不属于组:

createTCPEndPoint

createTCPEndPoint 命令将创建可以与 TCP 入站通道相关联的新端点。

目标对象

包含 TCPInboundChannel 的 TransportChannelService 的父实例。(ObjectName,必需)

必需参数

-name
指定新端点的名称。(字符串,必需)
-host
指定新端点的主机。(字符串,必需)
-port
指定新端点的端口。(字符串,必需)

可选参数

无。

样本输出

此命令将返回已创建的端点的对象名。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask createTCPEndPoint (cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TransportChannelService_1)
      {-name Sample_End_Pt_Name -host mybuild.location.ibm.com -port 8978}
  • 使用 Jython 字符串:
    AdminTask.createTCPEndPoint('cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TransportChannelService_1',
      '[-name Sample_End_Pt_Name -host mybuild.location.ibm.com -port 8978]')
  • 使用 Jython 列表:
    AdminTask.createTCPEndPoint('cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TransportChannelService_1', 
     ['-name', 'Sample_End_Pt_Name', '-host', 'mybuild.location.ibm.com', '-port', '8978'])

交互方式示例用法:

  • 使用 Jacl:
    $AdminTask createTCPEndPoint {-interactive}
  • 使用 Jython:
    AdminTask.createTCPEndPoint('-interactive')

getTCPEndPoint

getTCPEndPoint 命令获取指定的端点,该端点与 TCP 入站通道或包含 TCP 入站通道的链关联。

目标对象

TCPInboundChannel,或包含与 NamedEndPoint 关联的链、实例。(ObjectName,必需)

必需参数

无。

可选参数

无。

样本输出

此命令将返回与 TCP 入站通道实例或通道链相关联的现有指定端点的对象名。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask getTCPEndPoint TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01
    /servers/dmgr|server.xml#TCPInboundChannel_1)
    $AdminTask getTCPEndPoint DCS(cells/mybuildCell01/nodes/mybuildCellManager01
    /servers/dmgr|server.xml#Chain_3)
  • 使用 Jython 字符串:
    print AdminTask.getTCPEndPoint('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01
    /servers/dmgr|server.xml#TCPInboundChannel_1)')
    print AdminTask.getTCPEndPoint('DCS(cells/mybuildCell01/nodes/mybuildCellManager01
    /servers/dmgr|server.xml#Chain_3)')
  • 使用 Jython 列表:
    print AdminTask.getTCPEndPoint('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01
    /servers/dmgr|server.xml#TCPInboundChannel_1)')
    print AdminTask.getTCPEndPoint('DCS(cells/mybuildCell01/nodes/mybuildCellManager01
    /servers/dmgr|server.xml#Chain_3)')

交互方式示例用法:

  • 使用 Jacl:
    $AdminTask getTCPEndPoint {-interactive}
  • 使用 Jython:
    print AdminTask.getTCPEndPoint('-interactive')

帮助

help 命令提供 help 命令的摘要及调用管理命令的方法。可以在命令语法中使用通配符 (*) 或 Java 正则表达式 (.*) 以定制搜索查询。

目标对象

无。

可选参数

-commands
如果您使用 -commands 参数,那么 help 命令将提供可用管理命令的列表。(字符串,可选)
-commandGroups
如果您使用 -commandGroups 参数,那么 help 命令将提供管理命令组的列表。(字符串,可选)
-commandName
help 命令将提供有关给定管理命令的帮助信息。(字符串,可选)
-stepName
help 命令将提供有关管理命令的给定步骤的帮助信息。(字符串,可选)

样本输出

此命令将返回 AdminTask 对象的一般命令信息。

示例

批处理方式示例用法:

以下命令示例返回 AdminTask 对象的一般帮助信息:
  • 使用 Jacl:
    $AdminTask help
  • 使用 Jython:
    print AdminTask.help()
以下命令示例显示 AdminTask 对象的每个命令:
  • 使用 Jacl:
    $AdminTask help -commands
  • 使用 Jython:
    print AdminTask.help('-commands')
以下命令示例返回 AdminTask 对象的 createJ2CConnectionFactory 命令的详细命令信息:
  • 使用 Jacl:
    $AdminTask help createJ2CConnectionFactory
  • 使用 Jython:
    print AdminTask.help('createJ2CConnectionFactory')
以下示例说明使用通配符 (*) 返回包含 create 字符串的每个命令:
  • 使用 Jacl:
    $AdminTask help -commands *create*
  • 使用 Jython:
    print AdminTask.help('-commands *create*')
以下示例示范使用 Java 正则表达式 (.*) 的语法:
  • 使用 Jacl:
    $AdminTask help -commands <pattern>
  • 使用 Jython:
    print AdminTask.help('-commands <pattern>')

listTCPEndPoints

listTCPEndPoints 命令列示可与 TCP 入站通道关联的所有指定的端点。

目标对象

为其列出指定的端点候选值的 TCP 入站通道实例。(ObjectName,必需)

必需参数

无。

可选参数

-excludeDistinguished
指定是否仅显示非特别指定的端点。 此参数不需要值。(布尔值,可选)
-unusedOnly
指定是否显示未由其他 TCP 入站通道实例使用的指定端点。此参数不需要值。(布尔值,可选)

样本输出

此命令将返回指定的有效端点的对象名列表。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask listTCPEndPoints TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)
    $AdminTask listTCPEndPoints TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)
      {-excludeDistinguished}
    $AdminTask listTCPEndPoints TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)
       {-excludeDistinguished -unusedOnly}
  • 使用 Jython 字符串:
    print AdminTask.listTCPEndPoints('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)',
       '[-excludeDistinguished]')
    print AdminTask.listTCPEndPoints('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)', 
       '[-excludeDistinguished]')
    print AdminTask.listTCPEndPoints('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)',
       '[-excludeDistinguished -unusedOnly]')
  • 使用 Jython 列表:
    print AdminTask.listTCPEndPoints('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)',
      ['-excludeDistinguished'])
    print AdminTask.listTCPEndPoints('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)',
       ['-excludeDistinguished'])
    print AdminTask.listTCPEndPoints('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)',
      ['-excludeDistinguished', '-unusedOnly'])

交互方式示例用法:

  • 使用 Jacl:
    $AdminTask listTCPEndPoints {-interactive}
  • 使用 Jython:
    print AdminTask.listTCPEndPoints('-interactive')

listTCPThreadPools

listTCPThreadPools 命令列示可与 TCP 入站通道或 TCP 出站通道关联的所有线程池。

目标对象

列出线程池候选值的 TCPInboundChannel 或 TCPOutboundChannel 实例。(ObjectName,必需)

必需参数

无。

可选参数

无。

样本输出

此命令将返回有效线程池对象名的列表。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask listTCPThreadPools TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)
  • 使用 Jython 字符串:
    print AdminTask.listTCPThreadPools('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)')
  • 使用 Jython 列表:
    print AdminTask.listTCPThreadPools('TCP_1(cells/mybuildCell01/nodes/mybuildCellManager01/servers/dmgr|server.xml#TCPInboundChannel_1)')

交互方式示例用法:

  • 使用 Jacl:
    $AdminTask listTCPThreadPools {-interactive}
  • 使用 Jython:
    print AdminTask.listTCPThreadPools('-interactive')

updateAppOnCluster

updateAppOnCluster 命令可以用于为部署到集群的应用程序更新同步节点和重新启动集群成员。应用程序更新后,此命令可以 用于同步节点而不在同一时间停止所有节点上的所有集群成员。此命令一次同步一个节点。要使每个节点同步,停止应用程序的目标集群成员、执行节点同步操作并重新启动集群成员。

此命令的执行时间可能超过缺省连接器超时时间,这取决于目标集群所跨越的节点数。使用 SOAP 连接器时,务必在 profile_root/properties 目录下的 soap.client.props 文件中设置适当的超时值;使用 JSR160RMI 连接器或 RMI 连接器时,务必在 sas.client.props 文件中设置适当的超时值;使用 IPC 连接器时,务必在 ipc.client.props 文件中设置适当的超时值。

在本地方式下不支持此命令。

目标对象

无。

必需参数

-ApplicationNames
指定更新的应用程序的名称。(字符串,必需)

可选参数

-timeout
指定每个节点同步的超时值(以秒计)。 缺省值为 300 秒。(整数,可选)

样本输出

此命令不会返回输出。

示例

批处理方式示例用法:

  • 使用 Jacl:
    $AdminTask updateAppOnCluster {-ApplicationNames app1}
    $AdminTask updateAppOnCluster {-ApplicationNames app1 -timeout 600}
  • 使用 Jython 字符串:
    AdminTask.updateAppOnCluster('[-ApplicationNames app1]')
    AdminTask.updateAppOnCluster('[-ApplicationNames app1 -timeout 600]')
  • 使用 Jython 列表:
    AdminTask.updateAppOnCluster(['-ApplicationNames', 'app1'])
    AdminTask.updateAppOnCluster(['-ApplicationNames', 'app1', '-timeout', '600'])

交互方式示例用法:

  • 使用 Jacl:
    $AdminTask updateAppOnCluster -interactive
  • 使用 Jython:
    AdminTask.updateAppOnCluster('-interactive')

指示主题类型的图标 参考主题



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