Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use the wsadmin scripting AdminConfig object for scripted administration


Change the application server configuration using the wsadmin tool

We can use the wsadmin AdminConfig and AdminApp objects to make changes to the application server configuration. The purpose of this article is to illustrate the relationship between the commands that are used to change the configuration and the files that are used to hold configuration data. This discussion assumes that we have a network deployment installation, but the concepts are very similar for a application server installation.


Procedure

  1. Start wsadmin.sh.

    For this task, connect the wsadmin scripting client to the dmgr server in a network deployment environment.

  2. Set a variable for creating a server:

      ### Jacl

      set n1 [$AdminConfig getid /Node:mynode/]
      

      ### Jython

      n1 = AdminConfig.getid('/Node:mynode/')
      

  3. Create a server with the following command:

      ### Jacl

      set serv1 [$AdminConfig create Server $n1 {{name myserv}}]
      

    • Jython list:

      serv1 = AdminConfig.create('Server', n1, [['name', 'myserv']])
      

      ### Jython string

      serv1 = AdminConfig.create('Server', n1, '[[name myserv]]')
      

    After this command completes, some new files can be seen in a workspace used by the dmgr server on behalf of this scripting client. A workspace is a temporary repository of configuration information that administrative clients use. Any changes made to the configuration by an administrative client are first made to this temporary workspace. For scripting, when a save command is invoked on the AdminConfig object, these changes are transferred to the real configuration repository. Workspaces are kept in the wstemp subdirectory of a WAS installation.

  4. Make a configuration change to the server with the following command:

      ### Jacl

      $AdminConfig modify $serv1 {{stateManagement {{initialState STOP}}}}
      

    • Jython list:

      AdminConfig.modify(serv1, [['stateManagement', [['initialState', 'STOP']]]])
      

      ### Jython string

      AdminConfig.modify(serv1, '[[stateManagement  [[initialState  STOP]]]]')
      

    This command changes the initial state of the new server. After this command completes, one of the files in the workspace is changed.

  5. Save the configuration changes.

    Save the configuration changes:

    AdminConfig.save()
    

  6. In a network deployment environment only, synchronize the node.

    Use the syncActiveNode or syncNode scripts in the AdminNodeManagement script library to propagate the configuration changes to node or nodes.

    • Use the syncActiveNodes script to propagate the changes to each node in the cell:
      AdminNodeManagement.syncActiveNodes()
      

    • Use the syncNode script to propagate the changes to a specific node:
      AdminNodeManagement.syncNode("myNode")
      


Use the script library to automate the application serving environment using wsadmin.sh
Use the wsadmin scripting AdminConfig object for scripted administration


Related


Commands for the AdminConfig object using wsadmin.sh

+

Search Tips   |   Advanced Search