+

Search Tips   |   Advanced Search

PropertiesBasedConfiguration using wsadmin.sh

Use scripting to customize part of our system configuration using properties files. The WebSphere configuration repository stores many different types of configurations. We can use properties files to customize some of these configurations. We can customize some configurations created by the WebSphere Common Configuration Model (WCCM) or configurations deployed as Java EE applications.

The WebSphere Common Configuration Model is configured using the AdminConfig command in scripting. AdminConfig.types() lists the types in WCCM, and AdminConfig.attributes("type") lists the attributes for a specific type. Customizing these types using properties files is often easier than writing a script to make the same changes. In a production environment, Java EE applications are often deployed through the AdminApp command in scripting. For a development environment, the use of a properties file offers an easier to understand syntax when constructing the parameters needed to manage the application. Note that application deployment uses its own set of WCCM types.

Examples of configurations that we cannot directly configure through properties files include:

These configurations are managed through their own AdminTask commands. Note that there is an escape in properties files based configuration to invoke AdminTask commands. But this is just an alternative syntax to calling the commands. The actual configuration is not provided in the properties file.

Use properties files as follows:

  1. Examine samples documented in Managing specific configuration objects using properties files.

  2. Copy and paste applicable samples into a text file, edit the samples as needed, and apply the samples to the environment with suitable variable substitutions. There are many samples to cover a wide range of commonly used configurations.

  3. For a supported WCCM type, we can extract that type from an existing cell as the starting point, edit the extracted file, and apply it back to the existing cell.

    For supported WCCM types that are not Cell, Node, Server, or ServerCluster, extract the specific type from an existing cell with the option -options [[PortablePropertiesFile true]] to create a portable file format. Then, edit the properties file and apply it to a different cell with appropriate variable substitutions. We might use this approach to move commonly used configuration subsets such as resource definitions and Java virtual machine (JVM) settings from one environment to another.

Use properties files to customize, not replicate or merge environments. Do not extract an entire Cell, Node, Server, or ServerCluster to apply to a different environment. Only a subset of WCCM types are applied, and the extracted information is not merged with the new environment in a meaningful way.

The following WCCM types are supported:

AccessPointGroup ActivationSpec ActivationSpecTemplateProps ActivitySessionService
AdminObject AdminObjectTemplateProps AdminServerAuthentication AdminService
AllActivePolicy AllAuthenticatedUserExt AllAuthenticatedUsersInTrustedRealmsExt ApplicationProfileService
ApplicationServer Audit AuditEventFactory AuditNotificationMonitor
AuditPolicy AuditServiceProvider AuditSpecification AuthenticationMechanism
AuthenticationTarget AuthorizationConfig AuthorizationGroup AuthorizationGroupMember
AuthorizationProvider AuthorizationTableExt AuthorizationTableImpl BackupCluster
BridgeInterface CACertificate CAClient CMPConnectorFactory
CacheProvider Cell Certificate Chain
Classloader ClusterMember CommonSecureInterop CompensationService
ConfigSynchronizationService ConnectionDefTemplateProps ConnectionDefinition ConnectionPool
ConnectionTest Connector Cookie CoreGroup
CoreGroupAccessPoint CoreGroupBridgeService CoreGroupBridgeSettings CoreGroupServer
CryptoHardwareToken CustomAuthMechanism CustomService CustomUserRegistry
DCSInboundChannel DPClonableDeviceSettings DPClonableDeviceSettingsVersion DPDevice
DPDomain DPDomainVersion DPFirmware DPFirmwareVersion
DPManagedSet DPManager DRSConnectionPool DRSPartition
DRSSerialization DRSSettings DataPowerMgrInboundChannel DataReplication
DataReplicationDomain DataSource DebugService DiagnosticProviderService
DigestAuthentication DiskCacheCustomPerformanceSettings DiskCacheEvictionPolicy DistributionQueue
DynamicCache EJBCache EJBContainer EJBTimer
EndPoint ExternalCacheGroup EveryoneExt ExtensionMBean
ExtensionMBeanProvider GenericChannelFactory ExternalCacheGroupMember FileTransferService
Filter GenericOutboundChannel GenericInboundChannel GenericJMSConnectionFactory
GenericJMSDestination HTTPOutboundChannel HAManagerService HTTPConnector
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 JMSTransport
JavaProcessDef KeyReference KRB Key
KeyManager KeyStoreFile KeySet KeySetGroup
KeyStore Library 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 MonitorPolicy
NameServer ObjectCacheInstance Node 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 RMIConnector
RMQChannelFactory ResourceAdapter RSAToken Referenceable
RepositoryService ServerEntry ResourceEnvironmentProvider RoleAssignmentExt
SecurityRoleExt SIPContainerInboundChannel ServerExt ServerIndex
SIPContainer SOAPConnector SIPInboundChannel SIPOutboundChannel
SIPProxyInboundChannel SSLInboundChannel SPNEGO SSLConfig
SSLConfigGroup SchedulerProvider SSLOutboundChannel SWAMAuthentication
SchedulerConfiguration Security SchedulerService SecureAssociationService
SecureSocketLayer Server 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 TuneParams 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

Manage the system configuration:


applyConfigProperties

The applyConfigProperties command applies properties in a specific properties file to the configuration. The system adds attributes or configuration data to the configuration if a specific properties do not exist. If the properties exist in the configuration, the system sets the new values for the attributes.

Target object: None.

Required parameters:

Optional parameters:

Return value. The command does not return output.

Batch mode example usage

Interactive mode example usage


createPropertiesFileTemplates

The createPropertiesFileTemplates command creates template properties files to use to create or delete specific object types. The command stores the template properties file in the properties file specified by the propertiesFileName parameter.

Target object: None.

Required parameters:

Optional parameters: None

Return value

The command does not return output.

Batch mode example usage

Interactive mode example usage


deleteConfigProperties

The deleteConfigProperties command deletes properties in the configuration as designated in a properties file. The system removes the attributes or configuration data that corresponds to each property in the properties file.

Target object: None.

Required parameters:

Optional parameters:

Return value. The command does not return output.

Batch mode example usage

Interactive mode example usage


extractConfigProperties

The extractConfigProperties command extracts configuration data in the form of a properties file. The system exports the most commonly used configuration data and attributes, converts the attributes to properties, and saves the data to a file. We can specify the resource of interest with the target object or the configData parameter. Use the configData parameter to specify a server, node, cluster, policy set, or application instance. If no configuration object is specified, the command extracts the profile configuration data.

Target object:

Specify the object name of the configuration object of interest in the format: Node=nodeName:Server=serverName

Required parameters:

Optional parameters:

Return value.

The command returns the name of the properties file the system creates.

Batch mode example usage

Interactive mode example usage

Because of the way filtering works, when you extract many objects that are not hierarchically related from a large cell or node scope using SELECTED_SUBTYPE, the system scans parts of the cell or node that might not contain an instance of the targeted object type. We can achieve better performance by iteratively extracting each item and then targeting it explicitly. For example, if the goal is to extract all virtual hosts in a cell (compared to targeting the entire cell for extracting and filtering on the virtual host subtype), performance is improved by querying for all virtual hosts as one operation and then targeting each virtual host in a loop, as shown in the following example:

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 &ltVIRTUALHOSTNAME>.properties file for each virtualHost in the cell.


validateConfigProperties

The validateConfigProperties command verifies that the properties in the properties file are valid and can be successfully applied to the new configuration.

Target object: None.

Required parameters:

Optional parameters:

Return value.

The command returns a value of true if the system validates the properties file or policy set .zip file.

Batch mode example usage

Interactive mode example usage

  • Extracting properties files
  • Applying properties files
  • Validate properties files
  • Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
  • Deleting server, cluster, application, or authorization group objects using properties files
  • Create and delete configuration objects using properties files and wsadmin scripting
  • Extracting properties files to troubleshoot the environment
  • Manage environment configurations with properties files