I don't think the accepted answer is correct. After some googling, I found this in mongodb-user group to be the best answer.
To shutdown:
- Run db.runCommand({ replSetFreeze: numOfSeconds })
on secondaries to
prevent from promoting to primary
- Run rs.stepDown(seconds)
on the primary; it will check to make sure
at least one of the secondaries is sufficiently caught up to oplog
before stepping down. Choose a reasonably long wait time.
- Once everything is a secondary, db.shutdownServer()
on everything
To start up:
- Run rs.freeze(seconds)
on both secondaries with a lengthy timeout (say,
1-2 minutes)
- Bring up primary
- Use stepDown to fix in case a secondary somehow becomes primary
Simply shutting down is not enough, you have to prevent secondary nodes from promoting to primary.