The administration of 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 of the different cases, we will focus on some of the most common administrative 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. We perform maintenance by performing the following steps:
- First, we connect to one of the secondaries via the mongo shell. Then, we stop that secondary:
> use admin
> db.shutdownServer()
- Then, using the same...