+

Search Tips   |   Advanced Search

Disable components

We can disable components by invoking operations and wsadmin.sh. This topic describes how to disable the nameServer component of a configured server. We can modify the examples in this topic to disable other components.

There are two ways to complete this task. This topic uses the AdminConfig object to stop components in the environment. Alternatively, we can use the configureStateManageable script in the AdminServerManagement script library to enable and disable components. The wsadmin tool automatically loads the script when the tool starts. Use the following syntax to configure PMI settings using the configureStateManageable script:

For additional information and argument definitions, see the documentation for the AdminServerMananagment script library.

  1. Start the wsadmin scripting tool.

  2. Identify the server component and assign it to the nameServer variable.

    • Jacl:

        set nameServer [$AdminConfig list NameServer $server]

    • Jython:
      nameServer = AdminConfig.list('NameServer', server)
      print nameServer

    Example output:

      (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)

  3. List the components belonging to the server.

    List the components associated with the server, and assign the components to the components variable:

    • Jacl:

        set components [$AdminConfig list Component $server]

    • Jython:
      components = AdminConfig.list('Component', server)
      print components 

    The components variable contains a list of components.

    Example output:

    (cells/mycell/nodes/mynode/servers/server1|server.xml#ApplicationServer_1)
    (cells/mycell/nodes/mynode/servers/server1|server.xml#EJBContainer_1)
    (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)
    (cells/mycell/nodes/mynode/servers/server1|server.xml#WebContainer_1)

  4. Identify the nameServer component.

    Parse the components to identify the nameServer component, and assign it to the nameServer variable. Since the name server component is the third element in the list, retrieve this element by using an index of 2:

    • Jacl:

        set nameServer [lindex $components 2]

    • Jython:
      # get line separator  import  java
      lineSeparator = java.lang.System.getProperty('line.separator')
      arrayComponents = components.split(lineSeparator)
      nameServer = arrayComponents[2]
      print nameServer

    Example output:

      (cells/mycell/nodes/mynode/servers/server1|server.xml#NameServer_1)

  5. Disable the nameServer component.

    Modify the nested initialState attribute belonging to the stateManagement attribute to disable the nameServer component:

    • Jacl:

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

    • Jython:

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

  6. Save the configuration changes.

    Use the following command example to save the configuration changes:

      AdminConfig.save()

  7. 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")


Related tasks

  • Use the wsadmin scripting AdminConfig object for scripted administration

  • Server settings configuration scripts
  • Commands for the AdminConfig object