nerdexam
MongoDB

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

Backup and Recovery

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)
  • B
    4% (1)
  • C
    92% (24)
  • D
    4% (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()) - db is the database helper object; it has no stopBalancer() method. This command will throw an error.
  • B (db.stopserver()) - db doesn't have a stopserver() method either, and stopping the server entirely would defeat the purpose of taking a live backup.
  • D (sh.stopserverQ) - sh is the correct object, but stopserverQ is 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

#sharded cluster backup#balancer#sh.stopBalancer#backup procedure

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice