WAS v8.5 > Script the application serving environment (wsadmin) > Use properties files to manage system configurationManage environment configurations with properties files using wsadmin.sh
Use this topic to modify the environment using properties files. We can use wsadmin to generate, validate and apply properties files in the application server, profile, node, or other resource configurations. Using the PropertiesBasedConfiguration command group for AdminTask, we can extract the configuration attributes and values from the environment to properties files. We can use this functionality for various purposes, including:
- To modify your existing configuration in one location, instead of configuring multiple dmgr console panels or running many commands
- To improve the application development life cycle
We can use this topic to manage the following resources in the environment:
- Application servers
- Nodes
- Profiles
- Virtual hosts
- Authorization tables
- Data replication domains
- Variable maps
- Java™ Database Connectivity (JDBC) providers
- URL providers
- Mail providers
- Resource environment providers
- Java 2 Connector (J2C) resource adapters
We cannot apply a z/OS operating system properties file directly to a distributed operating system. Similarly, we cannot apply a distributed operating system properties file directly to a z/OS operating system. gotcha
To extract a properties file for an application server, edit the properties, and apply them to your configuration. We can also use interactive mode with these commands, as the following syntax demonstrates:
AdminTask.commandName('-interactive')
Modify an application server configuration, and apply the changes using a properties file.
- Launch wsadmin.
- Extract the application server configuration to modify.
Use the extractConfigProperties command to extract the object configuration, as the following Jython example demonstrates:
AdminTask.extractConfigProperties('-propertiesFileName ConfigProperties_server1.props -configData Server=server1')The system extracts the properties file, which contains each of the configuration objects and attributes for the server1 application server.
- Open the properties file, and manually edit the attribute values of interest.
Because you are manually editing the properties file, make a back-up copy of the properties file before you edit it. gotcha
The following sample is a section of an application server properties file:
# # Configuration properties file for cells/myCell/nodes/myNode/servers/server1|server.xml# # Extracted on Thu Sep 06 00:27:26 CDT 2007 # # # Section 1.0 ## cells/myCell/nodes/myNode/servers/server1|server.xml#server1 # # # SubSection 1.0 # Server Section # ResourceType=Server ImplementingResourceType=Server ResourceId=cells/myCell/nodes/myNode/servers/server1|server.xml#server1 # # #Properties # shortName=null serverType=APPLICATION_SERVER developmentMode=false #boolean name=server1 parallelStartEnabled=true #boolean clusterName=C modelId=null uniqueId=null #To modify the application server to run in development mode and disable parallel start, modify the developmentMode and parallelStartEnabled properties, as the following example demonstrates:
# # Configuration properties file for cells/myCell/nodes/myNode/servers/server1|server.xml# # Extracted on Thu Sep 06 00:27:26 CDT 2007 # # # Section 1.0 ## cells/myCell/nodes/myNode/servers/server1|server.xml#server1 # # # SubSection 1.0 # Server Section # ResourceType=Server ImplementingResourceType=Server ResourceId=cells/myCell/nodes/myNode/servers/server1|server.xml#server1 # # #Properties # shortName=null serverType=APPLICATION_SERVER developmentMode=true #boolean name=server1 parallelStartEnabled=false #boolean clusterName=C modelId=null uniqueId=null #- Validate the properties file.
Best practice: As a best practice, use the validateConfigProperties command to validate the modified properties file before applying the changes, as the following Jython example demonstrates.
AdminTask.validateConfigProperties('-propertiesFileName ConfigProperties_server1.props -reportFileName report.txt')The command returns a value of true if the system successfully validates the properties file. The command returns a value of false if the system does not validate the file.
- Apply the changes to the application server.
Use the applyConfigProperties command to apply the changes to the application server.
AdminTask.applyConfigProperties('-propertiesFileName ConfigProperties_server1.props -validate true')
- Save your configuration changes.
AdminConfig.save()
Subtopics
- Create, modify, and delete configuration objects using one properties file
We can specify to create, modify, and delete objects in one properties file. You run the applyConfigProperties command to apply the configuration changes.- Create and deleting configuration objects using properties files and wsadmin scripting
Use this topic to use an extracted properties file to create or delete configuration objects that are not server, cluster, application, or authorization group object types.- Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Use this topic to create new server, cluster, application, or authorization group objects for the configuration.- Delete server, cluster, application, or authorization group objects using properties files
Use this topic to delete server, cluster, application, or authorizationgroup objects from your configuration.
Related
Extracting properties files using wsadmin.sh
Applying properties files using wsadmin.sh
Validating properties files using wsadmin.sh
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Delete server, cluster, application, or authorization group objects using properties files
Create and deleting configuration objects using properties files and wsadmin scripting
Extracting properties files to troubleshoot the environment using wsadmin.sh
Manage servers and nodes with scripting
Reference:
PropertiesBasedConfiguration command group for AdminTask using wsadmin.sh