{"id":3694,"date":"2014-11-06T07:52:51","date_gmt":"2014-11-05T23:52:51","guid":{"rendered":"http:\/\/rmohan.com\/?p=3694"},"modified":"2014-11-06T07:52:51","modified_gmt":"2014-11-05T23:52:51","slug":"check-if-node-is-in-sync-with-dmgr-and-take-corrective-actions-using-wsadmin-tool","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3694","title":{"rendered":"check if node is in sync with dmgr and take corrective actions using wsadmin tool"},"content":{"rendered":"<p>Today\u2019s 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\u2019t require any preparation to complete this task.<\/p>\n<p>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.<\/p>\n<p>Please note that in out scenario WebSphere environment has security enabled<\/p>\n<p>Section 1<\/p>\n<p>First of all localize wsadmin tool on your host. It is located in <install_root>\/AppServer\/bin<\/p>\n<p>cd <install_root>\/AppServer\/bin<\/p>\n<p>Start wsadmin tool to connect to deployment manager<\/p>\n<p>wsadmin.sh -host <dmgr_server> -port <dmgr_SOAP_port> -conntype SOAP -username <admin_username> -password <admin_password><\/p>\n<p>If you provided correct values simillar output should appear on your screen indicating proper conection to deployment manager<\/p>\n<p>WASX7209I: Connected to process &#8220;dmgr&#8221; on node dmgr_node using SOAP connector; The<br \/>\ntype of process is: DeploymentManager<br \/>\nWASX7029I: For help, enter: &#8220;$Help help&#8221;<br \/>\nwsadmin><\/p>\n<p>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<\/p>\n<p>set node_name [$AdminControl completeObjectName type=NodeSync,node=my_node,*]<\/p>\n<p>You should see similar output if values are correct<\/p>\n<p>wsadmin>set node_name [$AdminControl completeObjectName type=NodeSync,node=my_node,*]<br \/>\nWebSphere:mbeanIdentifier=nodeSync,cell=my_cell,process=nodeagent,name=nodeSyn<br \/>\nc,platform=common,node=my_node,version=6.0.2.23,type=NodeSync<\/p>\n<p>Now, when we know the exact name of the node we can check if it is in sync with deployment manager<\/p>\n<p>$AdminControl invoke $node_name isNodeSynchronized<\/p>\n<p>If node is in sync with deployment manager you will see following output<\/p>\n<p>wsadmin>$AdminControl invoke $node_name isNodeSynchronized<br \/>\ntrue<br \/>\nwsadmin><\/p>\n<p>In other case when we we would proceed with following to get the node synchronized with dmgr<\/p>\n<p>$AdminControl invoke $node_name sync<\/p>\n<p>After synchronization process finishes you should see simillar output<\/p>\n<p>wsadmin>$AdminControl invoke $node_name sync<br \/>\ntrue<br \/>\nwsadmin><\/p>\n<p>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.<\/p>\n<p>Section 2<\/p>\n<p>In this section I\u2019ll focus on automating this process so we can check all of the nodes and take corective actions in case they are out of sync<\/p>\n<p>First, you have to create some file where we can work on our script. I have mine called syncNodes.jacl<\/p>\n<p>We need to set some array conaining list of nodes federated into deployment manager. Mine is called nodeList<\/p>\n<p>set nodeList [$AdminConfig list Node]<\/p>\n<p>Now we\u2019ll 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.<\/p>\n<p>foreach node $nodeList {<br \/>\nset node_name [$AdminConfig showAttribute $node name]<br \/>\nset complete_node_name [$AdminConfig completeObjectName type=NodeSync,node=$node_name,*]<br \/>\n&#8230;<br \/>\n&#8230;<br \/>\n}<\/p>\n<p>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<\/p>\n<p>if {!($complete_node_name==&#8221;&#8221;} then {<br \/>\nset in_sync [$AdminControl invoke $complete_node_name isNodeSynchronized]<br \/>\n&#8230;<br \/>\n&#8230;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today\u2019s 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\u2019t require any preparation to complete this task.<\/p>\n<p>I will divide this into two sections where first will show how to get the information about node [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3694"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3694"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3694\/revisions"}],"predecessor-version":[{"id":3695,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3694\/revisions\/3695"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}