Consider, I have 4 replicate sets and the config is as follows:
{
\"_id\": \"rs_0\",
\"version\": 5,
\"members\" : [
{\"_id\": 1, \"host\": \"127.0.0.1:
Follow below steps :
Go to mongo shell on Secondary servers
Stop the secondary servers by using below command : use admin db.shutdownServer()
Go to Linux shell- on secondary servers and type below command :
sudo service mongod stop
Starting the MongoDB replication -
Go to Linux shell - on secondary servers and type below command :
sudo service mongod start Starting the MongoDB replication -
Go to primary and type below commands to start the replication :
a] rs.initiate()
b] rs.add("Secondar -1:port no")
c] rs.add("Secondary-2:port no")
d] rs.add({ "_id" : 3, "host" : "Hidden_member:port no", "priority" : 0, "hidden" : true })
e] rs.status()