+

Search Tips   |   Advanced Search

Apply properties files using wsadmin.sh

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, we cannot apply a distributed operating system properties file directly to a z/OS operating system..

We can also use interactive mode with these commands...


Modify properties and apply file to the configuration

  1. Start the wsadmin scripting tool.

  2. 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
      

  3. Apply the modified properties to the configuration.


Use additional user modified variables to modify the configuration

  1. Start the wsadmin scripting tool.

  2. 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. 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
      
  3. Apply the modified properties to the configuration.

    Use the applyConfigProperties command to apply the properties file to the configuration...

      AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props]')


Modify the configuration by applying a properties file and a variable map

  1. Start the wsadmin scripting tool.

  2. 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=true
      

    The 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 

  3. Apply the modified properties to the configuration.

    Use the applyConfigProperties command to apply the properties file and the variable map file to the configuration...

      AdminTask.applyConfigProperties('[-propertiesFileName ejbcontainer.props -variablesMapFileName ejbprops.vars]')


What to do next

To verify the system made the changes to the configuration, extract the properties file from the configuration using the extractPropertiesFile command.


Subtopics


  • Extracting 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
  • Manage environment configurations with properties files
  • Extracting properties files to troubleshoot the environment
  • Manage servers, nodes and cells with scripting
  • PropertiesBasedConfiguration .