Change the WAS configuration using the wsadmin tool

 

Overview

Use the wsadmin AdminConfig and AdminApp objects to make changes to the WAS 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 you have a network deployment installation, but the concepts are very similar for a WAS installation.

 

Procedure

  1. Start wsadmin

  2. Set a variable for creating a server:

    where:

    set is a Jacl command
    n1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object that represents the WAS configuration
    getid is an AdminConfig command
    Node is the object type
    mynode is the name of the object to modify

  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]]')
      

    where:

    set is a Jacl command
    serv1 is a variable name
    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object that represents the WAS configuration
    create is an AdminConfig command
    Server is an AdminConfig object
    n1 evaluates to the ID of the host node that is specified in step number 1
    name is an attribute
    myserv is the value of the name attribute
    After this command completes, some new files can be seen in a workspace used by the deployment manager 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 WebSphere Application Server installation.

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

    where:

    $ is a Jacl operator for substituting a variable name with its value
    AdminConfig is an object that represents the WAS configuration
    modify is an AdminConfig command
    serv1 evaluates to the ID of the host node that is specified in step number 2
    stateManagement is an attribute
    initialState is a nested attribute within the stateManagement attribute
    STOP is the value of the initialState attribute
    This command changes the initial state of the new server. After this command completes, one of the files in the workspace is changed.

  5. Install an application on the server.

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


 

See Also


AdminConfig object for scripted administration

 

See Also


Commands for the AdminConfig object

 



 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.