Administration for a replica set can be significantly more complex than what is needed for single server deployments. In this section, instead of trying to exhaustively cover all different cases we will focus on some of the most common administration tasks that we will have to perform and how to do them.
Replica set administration
How to perform maintenance on replica sets
If we have some maintenance tasks that we have to perform in every member in a replica set, we always start with the secondaries first. First we connect via mongo shell to one of the secondaries. Then we stop this secondary:
> use admin
> db.shutdownServer()
Then, using the same user that was connected to the mongo shell in the previous step, we restart...