C100DBA · Question #58
You are in a sharded cluster. What will you do prior to initiating backup in sharded cluster?
The correct answer is C. sh.stopBalancer(). sh.stopBalancer() is correct because in MongoDB, sh is the shell helper object for sharding operations, and stopBalancer() is the proper method to halt the balancer process before taking a consistent backup - preventing chunk migrations from occurring mid-backup and causing data
Question
You are in a sharded cluster. What will you do prior to initiating backup in sharded cluster?
Options
- Adb.stopBalancer()
- Bdb.stopserver()
- Csh.stopBalancer()
- Dsh.stopserverQ
How the community answered
(26 responses)- B4% (1)
- C92% (24)
- D4% (1)
Explanation
sh.stopBalancer() is correct because in MongoDB, sh is the shell helper object for sharding operations, and stopBalancer() is the proper method to halt the balancer process before taking a consistent backup - preventing chunk migrations from occurring mid-backup and causing data inconsistencies across shards.
Why the distractors are wrong:
- A (
db.stopBalancer()) -dbis the database helper object; it has nostopBalancer()method. This command will throw an error. - B (
db.stopserver()) -dbdoesn't have astopserver()method either, and stopping the server entirely would defeat the purpose of taking a live backup. - D (
sh.stopserverQ) -shis the correct object, butstopserverQis not a real MongoDB method (it appears to be a fabricated distractor mixing server-stop terminology with a typo).
Memory tip: Think "sh = sharding" - anything related to shard-level cluster management uses the sh helper. Since the balancer is a sharding feature, pair it with sh: sh.stopBalancer().
Topics
Community Discussion
No community discussion yet for this question.