Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Configure applications using scripting


Modify the starting weight of applications using wsadmin scripting

We can use wsadmin.sh and scripting to modify the starting weight of an application.

Start wsadmin.sh.

If an application is running, changing an application setting causes the application to restart. On stand-alone servers, the application restarts after you save the change. On multiple-server products, the application restarts after you save the change and files synchronize on the node where the application is installed.

To control when synchronization occurs on multiple-server products, deselect Synchronize changes with nodes on the Console preferences page.

Complete the steps in this topic to modify the starting weight of an application.


Procedure

  1. Retrieve the configuration ID of the object that you want to modify and set it to a variable.

    For example, set the configuration ID to the dep variable. In this example, the object is the deployed application MyApp.

      ### Jacl

      set dep [$AdminConfig getid /Deployment:MyApp/]
      

      ### Jython

      dep = AdminConfig.getid("/Deployment:MyApp/")
      

  2. Identify the deployed object and set it to a variable. For example:

    For example, set the deployed object to the depObject variable:

      ### Jacl

      set depObject [$AdminConfig showAttribute $dep deployedObject]
      

      ### Jython

      depObject = AdminConfig.showAttribute(dep, "deployedObject")
      

  3. Show the current attribute values of the configuration object with the show command.

      ### Jacl

      $AdminConfig show $depObject startingWeight
      

      Example output:

      {startingWeight 1}
      

      ### Jython

      AdminConfig.show(depObject, 'startingWeight')
      

      Example output:

      [startingWeight 1]
      

  4. Modify the attributes of the configuration object with the modify command.

      ### Jacl

      $AdminConfig modify $depObject {{startingWeight 2}}
      

      ### Jython

      AdminConfig.modify(depObject, [['startingWeight', '2']])
      

  5. Verify the changes that you made to the attribute value with the show command.

      ### Jacl

      $AdminConfig show $depObject startingWeight
      

      Example output:

      {startingWeight 2}
      

      ### Jython

      AdminConfig.show(depObject, 'startingWeight')
      

      Example output:

      [startingWeight 2]
      

  6. Save the configuration changes.

    Save the configuration changes:

    AdminConfig.save()
    


Start the wsadmin scripting client 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