使用 wsadmin 脚本编制的 AdminTask 对象的 PropertiesBasedConfiguration 命令组
您可以使用脚本编制来利用属性文件定制一部分系统配置。 WebSphere 配置库存储许多不同类型的配置。 您可以使用属性文件来定制其中一些配置。 您可以定制由 WebSphere 公共配置模型 (WCCM) 创建的某些配置或者部署为 Java EE 应用程序的配置。
在脚本编制中使用 AdminConfig 命令来配置 WebSphere 公共配置模型。 AdminConfig.types() 列示 WCCM 中的类型,且 AdminConfig.attributes("type") 列示特定类型的属性。 使用属性文件来定制这些类型常常比编写脚本来进行相同更改更容易。 在生产环境中,Java EE 应用程序常常是通过脚本编制中的 AdminApp 命令来部署的。 对于开发环境,使用属性文件将在构造管理应用程序所需的参数时提供易于理解的语法。 请注意应用程序部署使用自己的 WCCM 类型组。
- SIBus
- 企业级应用程序
- 密钥和信任库文件
- Web Service 策略集文件
- 基于文件的用户注册表
- 检查“使用属性文件管理特定配置对象”中记录的样本。
- 将适用的样本复制并粘贴到文本文件中,根据需要编辑样本,然后在进行合适的变量替换后将样本应用于您的环境。 存在涵盖了范围广泛的常用配置的许多样本。
- 对于受支持的 WCCM 类型,一开始您可以从现有单元抽取该类型,编辑抽取的文件,然后将其应用于现有单元。
对于不受支持的 WCCM 类型 (不是单元,节点,服务器或 ServerCluster) ,请使用选项
-options [[PortablePropertiesFile true]]从现有单元中抽取特定类型以创建可移植文件格式。 然后,编辑属性文件并将具有相应变量替换的可移植文件格式应用于单元格。 该单元格可以是同一单元格,也可以是另一单元格。 您可能使用此方式将常用的配置子集(例如,资源定义和 Java 虚拟机 (JVM) 设置)从一个环境移到另一环境。
| AccessPointGroup | ActivationSpec | ActivationSpecTemplateProps | ActivitySessionService |
|---|---|---|---|
| AdminObject | AdminObjectTemplateProps | AdminServerAuthentication | AdminService |
| AllActivePolicy | AllAuthenticatedUserExt | AllAuthenticatedUsersInTrustedRealmsExt | ApplicationProfileService |
| ApplicationServer | 审计 | AuditEventFactory | AuditNotificationMonitor |
| AuditPolicy | AuditServiceProvider | AuditSpecification | AuthenticationMechanism |
| AuthenticationTarget | AuthorizationConfig | AuthorizationGroup | AuthorizationGroupMember |
| AuthorizationProvider | AuthorizationTableExt | AuthorizationTableImpl | BackupCluster |
| BridgeInterface | CACertificate | CAClient | CMPConnectorFactory |
| CacheProvider | Cell | 证书 | 链 |
| 类装入器 | ClusterMember | CommonSecureInterop | CompensationService |
| ConfigSynchronizationService | ConnectionDefTemplateProps | ConnectionDefinition | ConnectionPool |
| ConnectionTest | 连接器 | Cookie | CoreGroup |
| CoreGroupAccessPoint | CoreGroupBridgeService | CoreGroupBridgeSettings | CoreGroupServer |
| CryptoHardwareToken | CustomAuthMechanism | CustomService | CustomUserRegistry |
| DCSInboundChannel | DPClonableDeviceSettings | DPClonableDeviceSettingsVersion | DPDevice |
| DPDomain | DPDomainVersion | DPFirmware | DPFirmwareVersion |
| DPManagedSet | DPManager | DRSConnectionPool | DRSPartition |
| DataReplicationDomain | DataSource | DebugService | DiagnosticProviderService |
| DigestAuthentication | DiskCacheCustomPerformanceSettings | DiskCacheEvictionPolicy | DistributionQueue |
| DynamicCache | EJBCache | EJBContainer | EJBTimer |
| EndPoint | ExternalCacheGroup | EveryoneExt | ExtensionMBean |
| ExtensionMBeanProvider | GenericChannelFactory | ExternalCacheGroupMember | FileTransferService |
| 过滤 | GenericOutboundChannel | GenericInboundChannel | GenericJMSConnectionFactory |
| GenericJMSDestination | HTTPOutboundChannel | HAManagerService | HTTP 连接器 |
| HTTPInboundChannel | HostAlias | HTTPTransport | HTTPTunnelInboundChannel |
| HTTPTunnelOutboundChannel | IconType | I18NService | IIOPSecurityProtocol |
| IIOPTransport | InvalidationSchedule | IdentityAssertionLayer | IdentityAssertionQOP |
| IdentityAssertionTypeAssociation | J2EEResourcePropertySet | J2CActivationSpec | J2CAdminObject |
| J2CResourceAdapter | JAASLoginModule | JAASAuthData | JAASConfiguration |
| JAASConfigurationEntry | JFAPOutboundChannel | JDBCProvider | JFAPFactory |
| JFAPInboundChannel | JavaVirtualMachine | JMSProvider | JMS 传输 |
| JavaProcessDef | KeyReference | KRB | 键 |
| KeyManager | KeyStoreFile | KeySet | KeySetGroup |
| KeyStore | 库 | LDAPSearchFilter | LDAPUserRegistry |
| LTPA | MOfNPolicy | LibraryRef | ListenerPort |
| LocalOSUserRegistry | MQQueue | MQConnectionFactory | MQFAPInboundChannel |
| MQFAPOutboundChannel | MailProvider | MQQueueConnectionFactory | MQTopic |
| MQTopicConnectionFactory | MemoryCacheEvictionPolicy | MailSession | ManagementScope |
| MappingModule | MessageQOP | MessageLayer | MessageListener |
| MessageListenerService | NoOpPolicy | MimeEntry | MonitoringPolicy |
| NameServer | ObjectCacheInstance | 节点 | NodeGroup |
| ORBInboundChannel | ObjectPoolService | ObjectPool | ObjectPoolManagerInfo |
| ObjectPoolProvider | OutputRedirect | ObjectRequestBroker | OneOfNPolicy |
| OutboundResourceAdapter | PMIService | PME51ServerExtension | PMEServerExtension |
| PMIModule | PluginConfigService | PMRClusterExtension | PeerAccessPoint |
| PeerCoreGroup | PreferredServerPolicy | PluginProperties | PluginServerClusterProperties |
| PortletContainer | ProxyInboundChannel | PrimaryAdminExt | ProcessExecution |
| ProtocolProvider | RMQOutboundChannel | RASLoggingService | RMI 连接器 |
| RMQChannelFactory | ResourceAdapter | RSAToken | Referenceable |
| RepositoryService | ServerEntry | ResourceEnvironmentProvider | RoleAssignmentExt |
| SecurityRoleExt | SIPContainerInboundChannel | ServerExt | ServerIndex |
| SIPContainer | SOAP 连接器 | SIPInboundChannel | SIPOutboundChannel |
| SIPProxyInboundChannel | SSLInboundChannel | SPNEGO | SSLConfig |
| SSLConfigGroup | SchedulerProvider | SSLOutboundChannel | SWAMAuthentication |
| SchedulerConfiguration | 安全性 | SchedulerService | SecureAssociationService |
| SecureSocketLayer | 服务器 | SecurityDomain | SecurityPermission |
| SecurityProtocolQOP | ServletCacheInstance | ServerCluster | ServerIdentity |
| ServiceLog | SingleSignon | SessionBeanConfig | SessionDatabasePersistence |
| SessionManager | StaticPolicy | StartupBeansService | StateManageable |
| StatefulSessionBeanConfig | SystemMessageServer | StatisticsProvider | StreamRedirect |
| StringNameSpaceBinding | TCPOutboundChannel | TAInterceptor | TCPFactory |
| TCPInboundChannel | TimerManagerInfo | TPVService | TaskProvider |
| ThreadPool | TransactionService | TimerManagerProvider | TraceLog |
| TraceService | TransportQOP | TransportChannelFactory | TransportChannelService |
| TransportLayer | TuningParams | TrustAssociation | TrustManager |
| TrustedAuthenticationRealm | UDPInboundChannel | TunnelAccessPointGroup | TunnelPeerAccessPoint |
| TunnelTemplate | UserExt | UDPOutboundChannel | URL |
| URLProvider | WAS40DataSource | VariableMap | VirtualHost |
| WAS40ConnectionPool | WASTopicConnectionFactory | WASQueue | WASQueueConnectionFactory |
| WASTopic | WSSchedule | WIMUserRegistry | WLMCoreGroupBridgePlugin |
| WSNotification | WebModuleDeployment | WebContainer | WebContainerInboundChannel |
| WebModuleConfig | WorkAreaPartition | WebServer | WebserverPluginSettings |
| WeightAdvisor | WorkManagerProvider | WorkAreaPartitionService | WorkAreaService |
| WorkManagerInfo | WorkManagerService |
applyConfigProperties
applyConfigProperties 命令将特定属性文件中的属性应用于配置。 如果特定特性不存在,那么系统会将属性或配置数据添加至配置。 如果配置中存在这些特性,那么系统会为属性设置新值。
目标对象
无。
必需参数
- -propertiesFileName
- 指定要应用的属性文件的名称。 (字符串,必需)
可选参数
- -variablesMapFileName
- 指定变量映射文件的名称。 此文件包含系统从属性文件中使用的变量的值。 (字符串,可选)
- -variablesMap
- 指定要与属性文件一起使用的变量的值。 (属性,可选)
- -reportFileName
- 指定包含 applyConfigProperties 命令输出的报告文件的名称。 (字符串,可选)
- -reportFilterMechanism
- 指定报告过滤器机制的类型。 指定
All以显示所有报告信息。 指定Errors以显示错误信息。 指定Errors_And_Changes以显示错误和更改信息。 (字符串,可选) - -validate
- 指定在应用更改之前是否验证属性文件。 如果已验证属性文件但未报告任何错误,那么禁用属性文件验证可缩短总体命令执行时间。 缺省情况下,该命令会验证属性文件。 指定
false以禁用验证。 (布尔值,可选) - -zipFileName
- 指定压缩文件的名称,该文件包含您要应用于单元的策略集。 (字符串,可选)
返回值
此命令不会返回输出。
批处理方式示例用法
- 使用 Jython 字符串:
AdminTask.applyConfigProperties('-propertiesFileName myPropFile.props -zipFileName myZipFile.zip -validate true') - 使用 Jython 列表:
AdminTask.applyConfigProperties(['-propertiesFileName', 'myPropFile.props', '-zipFileName', 'myZipFile.zip', '-validate', 'true'])
交互方式示例用法
- 使用 Jython:
AdminTask.applyConfigProperties('-interactive')
createPropertiesFileTemplates
createPropertiesFileTemplates 命令创建要用来创建或删除特定对象类型的模板属性文件。 该命令会将模板属性文件存储在 propertiesFileName 参数指定的属性文件中。
目标对象
无。
必需参数
- -propertiesFileName
- 指定存储模板的属性文件的名称。 (字符串,必需)
- -configType
- 为要创建的模板指定资源类型。 (字符串,必需)
- 指定
Server以创建服务器类型属性文件模板。 - 指定
ServerCluster以创建服务器集群类型属性文件模板。 - 指定
Application以创建应用程序类型属性文件模板。 - 指定
AuthorizationGroup以创建授权组类型属性文件模板。
- 指定
可选参数
无返回值
此命令不会返回输出。
批处理方式示例用法
- 使用 Jython 字符串:
AdminTask.createPropertiesFileTemplates('-propertiesFileName serverTemplate.props -configType Server') - 使用 Jython 列表:
AdminTask.createPropertiesFileTemplates(['-propertiesFileName', 'serverTemplate.props', '-configType', 'Server'])
交互方式示例用法
- 使用 Jython:
AdminTask.createPropertiesFileTemplates('-interactive')
deleteConfigProperties
deleteConfigProperties 命令删除配置中的属性(如属性文件中所指定)。 系统会除去与特性 (property) 文件中每个特性 (property) 对应的属性或配置数据。
目标对象
无。
必需参数
- -propertiesFileName
- 指定要删除的属性文件的名称。 (字符串,必需)
可选参数
- -variablesMapFileName
- 指定变量映射文件的名称。 此文件包含系统从属性文件中使用的变量的值。 (字符串,可选)
- -variablesMap
- 指定要与属性文件一起使用的变量的值。 (属性,可选)
- -reportFileName
- 指定包含该命令输出的报告文件的名称。 (字符串,可选)
- -reportFilterMechanism
- 指定报告过滤器机制的类型。 指定
All以显示所有报告信息。 指定Errors以显示错误信息。 指定Errors_And_Changes以显示错误和更改信息。 (字符串,可选) - -validate
- 指定在应用更改之前是否验证属性文件。 缺省情况下,该命令会验证属性文件。 指定
false以禁用验证。 (布尔值,可选)
返回值
此命令不会返回输出。
批处理方式示例用法
- 使用 Jython 字符串:
AdminTask.deleteConfigProperties('-propertiesFileName myPropFile.props') - 使用 Jython 列表:
AdminTask.deleteConfigProperties(['-propertiesFileName', 'myPropFile.props'])
交互方式示例用法
- 使用 Jython:
AdminTask.deleteConfigProperties('-interactive')
extractConfigProperties
extractConfigProperties 命令以属性文件的形式抽取配置数据。 系统会导出最常使用的配置数据和属性、将这些属性转换为特性 (property) 以及将该数据保存至文件。 可以将相关资源与目标对象或 configData 参数一起指定。 使用 configData 参数来指定服务器、节点、集群、策略集或应用程序实例。 如果未指定任何配置对象,那么该命令会抽取概要文件配置数据。
目标对象
使用以下格式来指定相关配置对象的对象名:Node=nodeName:Server=serverName
必需参数
- -propertiesFileName
- 指定要抽取的属性文件的名称。 (字符串,必需)
可选参数
- -configData
- 使用格式
Node=node1指定配置对象实例。 (字符串,可选) - -options
- 指定其他配置选项,例如
GENERATETEMPLATE=true。 (属性,可选) - -filterMechanism
- 指定用于抽取配置属性的过滤器信息。 (字符串,可选)
- -selectedSubTypes
- 指定命令抽取属性时要包含的配置属性。 如果设置了 filterMechanism 参数
SELECTED_SUBTYPES,请指定此参数。 下列字符串是子类型的示例:ApplicationServer 和 EJBContainer。 (字符串,可选)表 2。 extractConfig属性-selectedSubTypes 子类型和扩展。 您可以配置对象类型和子类型的属性。 配置对象类型 子类型 扩展 AdminService 无 无 部署 ApplicationName 无 ApplicationServer TransactionService、DynamicCache、WebContainer、EJBContainer、PortletContainer、SIPContainer 和 WebserverPluginSettings 无 AuthorizationGroup 无 无 AuthorizationTableExt 无 无 Cell VirtualHost、DataReplicationDomain、ServerCluster、CoreGroup、NodeGroup、AuthorizationGroup、AuthorizationTableExt、Security、J2CResourceAdapter、JDBCProvider、JMSProvider、MailProvider、URLProvider、EventInfrastructureProvider、ObjectPoolProvider、WorkManagerProvider、TimerManagerProvider、SchedulerProvider、Node 和 VariableMap 无 CoreGroup 无 无 CoreGroupBridgeService 无 无 DynamicCache 无 无 EJBContainer 无 无 EventInfrastructureProvider 无 无 EventInfrastructureService 无 无 HAManagerService 无 无 J2CResourceAdapter 无 无 JDBCProvider 无 无 JMSProvider 无 无 JavaVirtualMachine 无 无 库 无 无 MailProvider 无 无 NameServer 无 无 节点 Server、J2CResourceAdapter、JDBCProvider、JMSProvider、MailProvider、URLProvider、EventInfrastructureProvider、ObjectPoolProvider、WorkManagerProvider、TimerManagerProvider、SchedulerProvider 和 VariableMap NodeMetadata 扩展抽取节点元数据属性。 NodeGroup 无 无 ObjectPoolProvider 无 无 ObjectRequestBroker 无 无 PMEServerExtension 无 无 PMIModule 无 无 PMIService 无 无 PortletContainer 无 无 SIPContainer 无 无 SchedulerProvider 无 无 安全性 JAASAuthData 无 服务器 PMIService、AdminService、CoreGroupBridgeService、TPVService、ObjectRequestBroker、ApplicationServer、NameServer、J2CResourceAdapter、JDBCProvider、JMSProvider、MailProvider、URLProvider、EventInfrastructureProvider、ObjectPoolProvider、WorkManagerProvider、TimerManagerProvider、SchedulerProvider、VariableMap、EventInfrastructureService、PMEServerExtension、Library、HAManagerService、PMIModule 和 Security 扩展为特定服务器列示已部署的应用程序。 ServerCluster J2CResourceAdapter、JDBCProvider、JMSProvider、MailProvider、URLProvider、ObjectPoolProvider、WorkManagerProvider、TimerManagerProvider、SchedulerProvider 和 VariableMap 扩展为特定集群列示已部署的应用程序。 TPVService 无 无 TimerManagerProvider 无 无 TransactionService 无 无 URLProvider 无 无 VariableMap 无 无 VirtualHost 无 无 WebContainer 无 无 WebserverPluginSettings 无 无 WorkManagerProvider 无 无 - -zipFileName
- 指定您希望将策略集抽取到其中的压缩文件的名称。 (字符串,可选)
返回值
该命令返回系统创建的属性文件的名称。
批处理方式示例用法
- 使用 Jython 字符串:
AdminTask.extractConfigProperties('-configData Node=myNode -propertiesFileName myNodeProperties.props -zipFileName myZipFile.zip') - 使用 Jython 列表:
AdminTask.extractConfigProperties(['-configData', 'Node=myNode', '-propertiesFileName', 'myNodeProperties.props', '-zipFileName', 'myZipFile.zip'])
交互方式示例用法
- 使用 Jython 字符串:
AdminTask.extractConfigProperties('-interactive')
for vhost in AdminConfig.list( 'VirtualHost' ).splitlines() :
name = AdminConfig.showAttribute( vhost, 'name' )
parms = '[-propertiesFileName ' + name + '.properties -configData VirtualHost=' + name + '
-options [[PortablePropertiesFile true]] ]'
AdminTask.extractConfigProperties(parms)This example produces a <VIRTUALHOSTNAME>.properties file for each virtualHost in the cell.validateConfigProperties
validateConfigProperties 命令验证属性文件中的属性是否有效以及是否可成功地应用于新配置。
目标对象
无。
必需参数
- -propertiesFileName
- 指定要验证的属性文件的名称。 (字符串,必需)
可选参数
- -variablesMapFileName
- 指定变量映射文件的名称。 此文件包含系统从属性文件中使用的变量的值。 (字符串,可选)
- -variablesMap
- 指定要与属性文件一起使用的变量的值。 (属性,可选)
- -reportFileName
- 指定包含 applyConfigProperties 命令输出的报告文件的名称。 (字符串,可选)
- -reportFilterMechanism
- 指定报告过滤器机制的类型。 指定
All以显示所有报告信息。 指定Errors以显示错误信息。 指定Errors_And_Changes以显示错误和更改信息。 (字符串,可选) - -zipFileName
- 指定压缩文件的名称,该文件包含您要应用于单元的策略集。 (字符串,可选)
返回值
如果系统验证属性文件或策略集 .zip 文件,那么此命令会返回值 true 。
批处理方式示例用法
- 使用 Jython 字符串:
AdminTask.validateConfigProperties('-propertiesFileName myNodeProperties.props -zipFileName myZipFile.zip -reportFileName report.txt') - 使用 Jython 列表:
AdminTask.validateConfigProperties(['-propertiesFileName', 'myNodeProperties.props', '-zipFileName', 'myZipFile.zip', '-reportFileName', 'report.txt'])
交互方式示例用法
- 使用 Jython:
AdminTask.validateConfigProperties('-interactive')