+

Search Tips   |   Advanced Search

Synchronize nodes using the wsadmin scripting tool

We can propagate node changes using scripting and the wsadmin tool.

There are two ways to complete this task. This topic uses the AdminControl object to synchronize nodes. Alternatively, we can use the node administration scripts in the AdminNodeManagement script library to synchronize a specific node, or to synchronize all active nodes.

A node synchronization is necessary in order to propagate configuration changes to the affected node or nodes. By default, this situation occurs periodically, as long as the node can communicate with the deployment manager. We can propagate changes explicitly by running commands that synchronize the configuration.


Tasks

  1. Set the variable for node synchronization.

    • Jacl:

        set Sync1 [$AdminControl completeObjectName type=NodeSync,process=nodeagent,node=myNodeName,*]
    • Jython:

        Sync1 = AdminControl.completeObjectName('type=NodeSync,process=nodeagent,node=myNodeName,*')

    AdminControl completeObjectName

    Attribute Definition
    set Jacl command
    Sync1 Variable name
    $ Jacl operator for substituting a variable name with its value
    AdminControl Enable the manipulation of MBeans running in a product process
    completeObjectName AdminControl command
    type=NodeSync,process=nodeagent,node=myNodeName Fragment of the object name. The complete name is returned by this command. This fragment is used to find the matching object name which is the SyncNode object for the myNodeName node, where myNodeName is the name of the node used to synchronize configuration changes. For example: type=Server, name=serv1. It can be any valid combination of domain and key properties. For example, type, name, cell, node, process, and so on.

    Example output:

    WebSphere:platform=common,cell=myNetwork,version=5.0,name=node
    Sync,mbeanIdentifier=nodeSync,type=NodeSync,process=nodeagent,node=myBaseNode,
    process=nodeagent
    
  2. Synchronize the node:

    • Jacl: $AdminControl invoke $Sync1 sync
    • Jython: AdminControl.invoke(Sync1, 'sync')

    AdminControl invoke command description.

    Attribute Definition
    $ Jacl operator for substituting a variable name with its value
    AdminControl Enable the manipulation of MBeans running in a product process
    invoke AdminControl command
    Sync1 Evaluate the ID of the server specified in step number 1
    sync Attribute of modify command

    Example output: true

    You receive an output value of true, if the synchronization completes.

When the synchronization is complete, the files created in the config directory for the deployment manager now exist on the myNodeName node in the directory...

  • wsadmin AdminConfig
  • Add, manage, and remove nodes
  • Node administration scripts
  • Commands for the AdminConfig object