Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use properties files to manage system configuration
Apply properties files using wsadmin.sh
Use this topic and wsadmin.sh to apply modified configuration properties to the environment using properties files.
Use the extractConfigProperties command in the PropertiesBasedConfiguration command group to extract the properties files of interest. Use a text editor to modify one or more values in the properties file.
Use the validateConfigProperties command in the PropertiesBasedConfiguration command group to validate the modified properties file before applying the file to the configuration. We cannot apply a z/OS operating system properties file directly to a distributed operating system. Similarly, you cannot apply a distributed operating system properties file directly to a z/OS operating system.
We can also use interactive mode with these commands, as the following syntax demonstrates:
AdminTask.commandName('-interactive')
Procedure
- Modify one or more properties and apply the properties file to the configuration.
- Start wsadmin.sh.
- Modify the properties of interest.
In the following properties file, use a text editor to change the value of the enableSFSB property:
# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer= ID#ApplicationServer_1:EJBContainer=ID#EJBContainer_1AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp" enableSFSBFailover=true #boolean server=null parentComponent=WAS ND Server EnvironmentVariablesSection # # #Environment Variables #Thu Apr 17 14:10:31 CDT 2008 hostName2=* hostName1=localhost cellName=IBM-49F7FB781FECell07 nodeName=IBM-49F7FB781FECellManager07 hostName=IBM-49F7FB781FE.austin.ibm.com serverName=dmgr enableSSB=true- Apply the modified properties to the configuration.
Use applyConfigProperties to apply the properties file to the configuration, as the following Jython example demonstrates:
AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props]')
- Use additional user modified variables to modify the configuration.
- Start wsadmin.sh.
- Use additional variables to modify the enableSFSBFailover property of the EJB container, changing the value from true to false.
In the following properties file, modify the enableSFSBFailover property by specifying the value as the !{enableSSB} variable. We can use the variable in the section header or in the properties part of the section. Also, one property value can contain multiple variables as shown for ResourceId.
# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=ID#ApplicationServer_1: EJBContainer=ID#EJBContainer_1 AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp" enableSFSBFailover=!{enableSSB} #boolean server=null parentComponent=WAS ND Server EnvironmentVariablesSection # # #Environment Variables #Thu Apr 17 14:10:31 CDT 2008 hostName2=* hostName1=localhost cellName=IBM-49F7FB781FECell07 nodeName=IBM-49F7FB781FECellManager07 hostName=IBM-49F7FB781FE.austin.ibm.com serverName=dmgr enableSSB=true- Apply the modified properties to the configuration.
Use applyConfigProperties to apply the properties file to the configuration, as the following Jython example demonstrates:
AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props]')
- Modify the configuration by applying a properties file and a variable map.
- Start wsadmin.sh.
- Modify the enableSFSBFailover property of the EJB container, changing the value from true to false.
Modify the enableSFSBFailover property by specifying the value as the !{enableSSB} variable in a separate variable map file. Instead of specifying the variable in the section header or in the properties part of the section, create a separate variable map file. The following code displays a sample variable map file:
ejbprops.vars: # # #Environment Variables #Day Month 11 Time CDT Year hostName2=* hostName1=localhost cellName=myCell nodeName=myNode hostName=myhost.com serverName=myServer enableSSB=trueThe following code displays the corresponding properties file to apply to the configuration:
# # SubSection 1.0 # EJBContainer # ResourceType=EJBContainer ImplementingResourceType=EJBContainer ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:ApplicationServer=ID#ApplicationServer_1: EJBContainer=ID#EJBContainer_1 AttributeInfo=components # # #Properties # EJBTimer={} #ObjectName*(null) name=null defaultDatasourceJNDIName=null inactivePoolCleanupInterval=30000 #long passivationDirectory="${USER_INSTALL_ROOT}/temp" enableSFSBFailover=true#boolean server=null parentComponent=WAS ND Server- Apply the modified properties to the configuration.
Use applyConfigProperties to apply the properties file and the variable map file to the configuration, as the following Jython example demonstrates:
AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props -variablesMapFileName ejbprops.vars]')
What to do next
To verify that the system made the changes to the configuration, extract the properties file from the configuration using the extractPropertiesFile command.
Extract properties files using wsadmin.sh
Validate 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 delete configuration objects using properties files and wsadmin scripting
Manage environment configurations with properties files using wsadmin.sh
Extract properties files to troubleshoot the environment using wsadmin.sh
Manage servers and nodes with scripting
Related
PropertiesBasedConfiguration command group using wsadmin.sh