使用属性文件和 wsadmin 脚本编制来创建服务器、集群、应用程序或授权组对象

使用本主题,为配置创建新的服务器、集群、应用程序或授权组对象。

关于此任务

通过 AdminTask 对象的 PropertiesBasedConfiguration 命令组,您可以使用属性文件,在环境中创建配置对象。

避免故障 避免故障: 无法将 z/OS® 操作系统属性文件直接应用到分布式操作系统。类似地,您无法将分布式操作系统属性文件直接应用到 z/OS 操作系统。gotcha

过程

  1. 启动 wsadmin 脚本编制工具。
  2. 创建属性文件模板。
    创建属性文件模板,以用于创建新的服务器、集群、应用程序或授权组对象。使用 -configType 参数并遵循以下准则来指定要创建的模板的类型:
    • 指定 Server 以创建服务器类型属性文件模板。
    • 指定 ServerCluster 以创建服务器集群类型属性文件模板。
    • 指定 Application 以创建应用程序类型属性文件模板。
    • 指定 AuthorizationGroup 以创建授权组类型属性文件模板。
    以下 Jython 示例使用 createPropertiesFileTemplates 命令来创建新的 AuthorizationGroup 对象模板:
    AdminTask.createPropertiesFileTemplates('[-propertiesFileName authorizationGroup.template
       -configType AuthorizationGroup]')
    此命令会生成类似以下样本模板的模板文件:
    #
    # Create parameters
    # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed
    # Set necessary parameters under each command or step sections
    # Invoke applyConfigProperties command using this properties file.
    #
    ResourceType=AuthorizationGroup
    ImplementingResourceType=AuthorizationGroup
    ResourceId=AuthorizationGroup=
    SKIP=true
    CreateDeleteCommandProperties=true
    #
    
    #
    #Properties
    #
    authorizationGroupName=authorizationGroupName #String,required
    commandName=createAuthorizationGroup
  3. 修改新的模板文件。

    通过设置必需参数来修改新的 AuthorizationGroup 模板文件。您也可以修改可选参数,但必须修改必需参数。将 SKIP 必需属性值从 SKIP=true 更改为 SKIP=false,以指示系统应该将属性文件的特定部分中的属性应用到配置。要忽略属性文件的特定部分,请将 SKIP 属性设置为 SKIP=true

    #
    # Create parameters
    # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed
    # Set necessary parameters under each command or step sections
    # Invoke applyConfigProperties command using this properties file.
    #
    ResourceType=AuthorizationGroup
    ImplementingResourceType=AuthorizationGroup
    ResourceId=AuthorizationGroup=
    SKIP=false
    CreateDeleteCommandProperties=true
    #
    
    #
    #Properties
    #
    authorizationGroupName=ag1 #String,required
    commandName=createAuthorizationGroup
  4. 将所修改的属性应用到配置。
    使用 applyConfigProperties 命令将属性文件应用到配置,如以下 Jython 示例所示:
    AdminTask.applyConfigProperties('[-propertiesFileName authorizationGroup.template]')

    此命令会在配置中创建 ag1 授权组。

  5. 保存配置更改。
    请使用以下命令示例来保存配置更改:
    AdminConfig.save()

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



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