December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

check if node is in sync with dmgr and take corrective actions using wsadmin tool

Today’s objective is to check if WebSphere nodes are synchronized and take respective actions depending on the results. I will try to be as clear as possible so, you won’t require any preparation to complete this task.

I will divide this into two sections where first will show how to get the information about node synchronization status and invoking synchronization for the node. Second one will describe the process of automatin the first one and execute the same task for all of the nodes federated into our cell.

Please note that in out scenario WebSphere environment has security enabled

Section 1

First of all localize wsadmin tool on your host. It is located in /AppServer/bin

cd /AppServer/bin

Start wsadmin tool to connect to deployment manager

wsadmin.sh -host -port -conntype SOAP -username -password

If you provided correct values simillar output should appear on your screen indicating proper conection to deployment manager

WASX7209I: Connected to process “dmgr” on node dmgr_node using SOAP connector; The
type of process is: DeploymentManager
WASX7029I: For help, enter: “$Help help”
wsadmin>

Assign node name to some varible I have used node_name in this example and my_node is the name of the node you would like to synchronize

set node_name [$AdminControl completeObjectName type=NodeSync,node=my_node,*]

You should see similar output if values are correct

wsadmin>set node_name [$AdminControl completeObjectName type=NodeSync,node=my_node,*]
WebSphere:mbeanIdentifier=nodeSync,cell=my_cell,process=nodeagent,name=nodeSyn
c,platform=common,node=my_node,version=6.0.2.23,type=NodeSync

Now, when we know the exact name of the node we can check if it is in sync with deployment manager

$AdminControl invoke $node_name isNodeSynchronized

If node is in sync with deployment manager you will see following output

wsadmin>$AdminControl invoke $node_name isNodeSynchronized
true
wsadmin>

In other case when we we would proceed with following to get the node synchronized with dmgr

$AdminControl invoke $node_name sync

After synchronization process finishes you should see simillar output

wsadmin>$AdminControl invoke $node_name sync
true
wsadmin>

This is the end of section one where we were able to check if node is synchronized with deployment manager along with initiating synchronization process.

Section 2

In this section I’ll focus on automating this process so we can check all of the nodes and take corective actions in case they are out of sync

First, you have to create some file where we can work on our script. I have mine called syncNodes.jacl

We need to set some array conaining list of nodes federated into deployment manager. Mine is called nodeList

set nodeList [$AdminConfig list Node]

Now we’ll need to get the node names and than transform it to completeObjectName to be able to work further so, I will create loop taking care of it.

foreach node $nodeList {
set node_name [$AdminConfig showAttribute $node name]
set complete_node_name [$AdminConfig completeObjectName type=NodeSync,node=$node_name,*]


}

Once I have complete node name I have to check if this node is synchronized so, right below I am including command form section one but the output will be stored in variable in_sync for further actions

if {!($complete_node_name==””} then {
set in_sync [$AdminControl invoke $complete_node_name isNodeSynchronized]


}

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>