Reputation: 12557
We have a MongoDB cluster and would like to restart all members of a cluster.
We could automate the windows services to restart or use shutdownServer
via mognoshell.
But we don't want to have the database unavailable, so an idea would be to only restart the slaves, make a step down, then restart the old master.
I know I can determine masters and slaves with rs.status()
and with rs.StepDown()
and rs.freeze()
I can manage who the primary is.
But is there an built in way to restart a MongoDB cluister without downtime? Or would I have to write a tool which reads the status of the server and then handles this manually?
Upvotes: 1
Views: 446
Reputation: 9473
There is no "safe restart" mechanism build in mongo yet.
To solve that, custom tool will have to follow those steps:
....
When stepdown is issued - all clients are forcibly disconnected from master, but reconnection will be made to new master immediately.
Upvotes: 1