Monday, September 6, 2021

MongoDB Hardware Upgrade

Following are the steps will help us at the time of  hardware enhancement of the MongoDB Nodes.  


Replication Cluster:

Step1 :Login to any server and check for ps -aef | grep mongo , login to node , check for rs.status() and then check for rs.printslaveReplicationInfo() , confirm there should not be any lag between the nodes.

Step2 :login to the secondary server and check for ps -aef | grep mongo , login to secondary  node  and run the below command

   use admin , db.shutdownServer() and handover the server to IT team for uplift

Step3: After reboot of server check for the mongo processes (ps -ef|grep mongo) and login to node and check for replication health status [rs.status() ,rs.printslaveReplicationInfo() etc. ]

Step4 :Repeat step 1 to 3 if any other secondary nodes are present in cluster.

step5: Login to primary server and check for ps -aef | grep mongo , login to node , check for rs.status() and then check for rs.printslaveReplicationInfo() , confirm there should not be any lag between the nodes.

Step6 :Run the below query from the admin db 

 use admin , rs.stepDown()  wait until the preference changes to secondary [confirm Primary node has been elected successfully in the node by using command rs.status()]

           db.shutdownServer() and handover the server to IT team for uplift

Step7 :After reboot of server check for the mongo processes (ps -ef|grep mongo) and login to node and check for replication health status [rs.status() ,rs.printslaveReplicationInfo() etc. ]

Step 8 :If any Arbiter node is present , hardware uplift is not mandatory for this as this node doesn't contain any data.

Sharded Cluster :

Data node : shard_0 , shard_1 , shard_2 etc.

Config server : node_0 , node_1, node_2

Query Router : Router_1 , Router_2 , Router_3 etc.

Data node : Follow the same steps as for replication steps for each server in the shard node.

Config server : Follow the same steps as for replication steps for each server in the config server.

Query Router :

Step 1 :Login to router server and check for ps - aef | grep mongo , and stop the mongo service as [service mongod stop

Note : perform the operation router by router 

step:2 : Handover the server to IT team for hardware uplift , after reboot check for the mongo services [ps - aef| grep mongo]

No comments:

Post a Comment