使用 wsadmin 脚本编制来抽取属性文件
使用本主题,从配置中抽取属性文件。您可以使用 wsadmin 工具来抽取单元、服务器、服务器子类型以及节点配置的属性文件。
关于此任务
使用 AdminTask 对象的 PropertiesBasedConfiguration 命令组,您可以将配置属性和值从环境抽取到属性文件。

AdminTask.extractConfigProperties('-interactive')
过程
- 抽取单元配置。
- 启动 wsadmin 脚本编制工具。
- 抽取单元配置。 使用 extractConfigProperties 命令来抽取对象配置,如以下 Jython 示例所示:
AdminTask.extractConfigProperties('[-propertiesFileName ConfigProperties_cell.props]')
系统会抽取属性文件,如以下示例所示:Cell.props # # SubSection 1.0 # Cell level attributes # ResourceType=Cell ImplementingResourceType=Cell ResourceId=Cell=!{cellName} # # #Properties # shortName=null cellType=DISTRIBUTED #ENUM(UDP|TCP|MULTICAST|DISTRIBUTED|STANDALONE),readonly name=!{cellName} multicastDiscoveryAddressEndpointName=null discoveryAddressEndpointName=null cellDiscoveryProtocol=TCP #ENUM(UDP|TCP|MULTICAST) …. … Properties of nodes,servers, clusters, applications, etc. …. EnvironmentVariablesSection # # #Environment Variables #Day Month 17 Time CDT Year cellName=myCell
属性文件不会显示单元、节点、服务器、集群、应用程序、核心组或节点组名。相反,此命令将创建变量(例如 !{cellName}),并将其包括在属性文件末尾的 EnvironmentVariables 部分中。EnvironmentVariables 部分包含属性文件中的每个变量。
- 抽取服务器配置。
- 启动 wsadmin 脚本编制工具。
- 抽取相关应用程序服务器配置。 使用 extractConfigProperties 命令来抽取服务器配置,如以下 Jython 示例所示:
AdminTask.extractConfigProperties('[-propertiesFileName ConfigProperties_server1.props -configData Server=server1]')
系统会抽取属性文件,如以下示例所示:# # SubSection 1.0 # Server Section # ResourceType=Server ImplementingResourceType=Server ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName} # # #Properties # shortName=null serverType=DEPLOYMENT_MANAGER #readonly developmentMode=false #boolean parallelStartEnabled=true #boolean name=!{serverName} clusterName=null uniqueId=null modelId=null … … Properties of other inner objects ( EJBContainer, WebContainer, ORB etc) and subtypes not shown. … EnvironmentVariablesSection # #Environment Variables #Day Month 16 Time CDT Year cellName=myCell nodeName=myNode hostName=myHost.com serverName=dmgr
属性文件不会显示单元、节点、服务器、集群、应用程序、核心组或节点组名。相反,此命令将创建变量(例如 !{cellName}),并将其包括在属性文件末尾的 EnvironmentVariables 部分中。EnvironmentVariables 部分包含属性文件中的每个变量。
- 抽取特定服务器的服务器子类型配置。
- 启动 wsadmin 脚本编制工具。
- 抽取特定服务器的 EJB 容器属性和 Web 容器属性。 使用 extractConfigProperties 命令来抽取服务器配置,如以下 Jython 示例所示:
AdminTask.extractConfigProperties('[-propertiesFileName ejbcontainer.props -configData Server=server1 -filterMechanism SELECTED_SUBTYPES -selectedSubTypes [EJBContainer WebContainer]]')
系统会抽取属性文件,如以下示例所示:# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer= ID#ApplicationServer_1:EJBContainer=ID#EJBConntainer_1 AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp" enableSFSBFailover=false #boolean server=null parentComponent= WebSphere Application Server Network Deployment Server # # SubSection 1.0 # WebContainer # ResourceType=WebContainer ImplementingResourceType=WebContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer= ID#ApplicationServer_1:WebContainer=ID#WebConntainer_1 AttributeInfo=components # # #Properties # enableServletCaching=false #boolean name=null defaultVirtualHostName=null server=null maximumPercentageExpiredEntries=15 #integer asyncIncludeTimeout=60000 #integer parentComponent=WebSphere Application Server Network Deployment Server disablePooling=false #boolean sessionAffinityFailoverServer=null maximumResponseStoreSize=100 #integer allowAsyncRequestDispatching=false #boolean sessionAffinityTimeout=0 #integer EnvironmentVariablesSection # #Environment Variables #Thu Apr 17 14:17:25 CDT 2008 cellName=myCell nodeName=myNode hostName=myhost.com serverName=dmgr
属性文件不会显示单元、节点、服务器、集群、应用程序、核心组或节点组名。相反,此命令将创建变量(例如 !{cellName}),并将其包括在属性文件末尾的 EnvironmentVariables 部分中。EnvironmentVariables 部分包含属性文件中的每个变量。
EJBContainer=ID#EJBContainer_1 字符串代表服务器中的 EJBContainer 对象。在配置中使用此 XML 标识来唯一识别该对象。在将属性文件应用到配置前,您可以将此字段修改为 EJBContainer=myContainer(如果已在配置中将名称字段设置为 myContainer)。
- 抽取节点属性,而不遍历节点的子类型。
- 启动 wsadmin 脚本编制工具。
- 抽取节点属性(服务器和资源的特定子类型属性除外)。 使用 extractConfigProperties 命令来抽取节点配置属性,如以下 Jython 示例所示:
AdminTask.extractConfigProperties('[-propertiesFileName node.props -configData Node=myNode -filterMechanism NO_SUBTYPES]')
系统会抽取属性文件,如以下示例所示:# # SubSection 1.0 # Node Section # ResourceType=Node ImplementingResourceType=Node ResourceId=Cell=!{cellName}:Node=!{nodeName} # # #Properties # shortName=null name=!{nodeName} maxFilePermissionForApps=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 " discoveryProtocol=TCP #ENUM(UDP|TCP|MULTICAST) hostName=!{hostName} # ## Section 1.0_1#Cell=!{cellName}:Node=!{nodeName} # ResourceType=Node ImplementingResourceType=Node ExtensionId=NodeMetadataExtension ResourceId=Cell=!{cellName}:Node=!{nodeName} # nodeOS=distributed nodeVersion=7.0.0.0 # # End of Section 1.0_1# Cell=!{cellName}:Node=!{nodeName} # # # End of Section 1.0# Cell=!{cellName} :Node=!{nodeName} # EnvironmentVariablesSection # #Environment Variables #Day Month 17 Time CDT Year cellName=myCell nodeName=myNode
属性文件不会显示单元、节点、服务器、集群、应用程序、核心组或节点组名。相反,此命令将创建变量(例如 !{cellName}),并将其包括在属性文件末尾的 EnvironmentVariables 部分中。属性文件的 EnvironmentVariables 部分包含该文件中的每个变量。
- 抽取节点属性,而不遍历节点的子类型或对扩展进行调用。
- 启动 wsadmin 脚本编制工具。
- 抽取节点属性(服务器和资源的特定子类型属性除外,且不调用扩展)。 使用 extractConfigProperties 命令来抽取节点配置属性,如以下 Jython 示例所示:
AdminTask.extractConfigProperties('[-propertiesFileName node.props -configData Node=myNode -filterMechanism NO_SUBTYPES_AND_EXTENSIONS]')
系统会抽取属性文件,如以下示例所示:# # SubSection 1.0 # Node Section # ResourceType=Node ImplementingResourceType=Node ResourceId=Cell=!{cellName}:Node=!{nodeName} # # #Properties # shortName=null name=!{nodeName} maxFilePermissionForApps=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 " discoveryProtocol=TCP #ENUM(UDP|TCP|MULTICAST) hostName=!{hostName} # ## Section 1.0_1#Cell=!{cellName}:Node=!{nodeName} # ResourceType=Node ImplementingResourceType=Node ExtensionId=NodeMetadataExtension ResourceId=Cell=!{cellName}:Node=!{nodeName} # nodeOS=distributed nodeVersion=7.0.0.0 # # End of Section 1.0_1# Cell=!{cellName}:Node=!{nodeName} # # # End of Section 1.0# Cell=!{cellName}:Node=!{nodeName} # EnvironmentVariablesSection # #Environment Variables #Day Month 17 Time CDT Year cellName=myCell nodeName=myNode
此命令不会将 NodeMetadataExtension 部分包括在所抽取的属性文件中,因为 NodeMetadataExtension 是节点资源的扩展。属性文件不会显示单元、节点、服务器、集群、应用程序、核心组或节点组名。相反,此命令将创建变量(例如 !{cellName}),并将其包括在属性文件末尾的 EnvironmentVariables 部分中。属性文件的 EnvironmentVariables 部分包含该文件中的每个变量。
下一步做什么
在抽取属性文件后,可将此功能用于各种用途,其中包括:
- 在一个位置中修改现有配置,而不必配置多个管理控制台面板或运行多个命令
- 改善应用程序开发生命周期
您可以使用属性文件来管理环境中的以下服务器子类型:
- 应用程序服务器
- 节点
- 概要文件
- 虚拟主机
- 应用程序
- 授权表
- 数据复制域
- 变量映射
- Java™ 数据库连接 (JDBC) 提供程序
- 统一资源定位符 (URL) 提供程序
- 邮件提供程序
- 资源环境提供程序
- Java™ 2 连接器 (J2C) 资源适配器


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_7extractprops
文件名:txml_7extractprops.html