nerdexam
MongoDB

C100DBA · Question #62

Which of the following needs to be performed prior to initiate backup on a sharded cluster?

The correct answer is D. sh.stopBalancer( ). sh.stopBalancer() is correct because in MongoDB, the sh object is the sharding helper, and stopping the balancer is required before backup to prevent chunk migrations between shards mid-snapshot, which would leave data in an inconsistent state across nodes. Option A…

Backup and Recovery

Question

Which of the following needs to be performed prior to initiate backup on a sharded cluster?

Options

  • Adb.stopBalancer( )
  • Bsh.stopServer( )
  • Cdb.stopServer( )
  • Dsh.stopBalancer( )

How the community answered

(37 responses)
  • A
    5% (2)
  • B
    3% (1)
  • D
    92% (34)

Explanation

sh.stopBalancer() is correct because in MongoDB, the sh object is the sharding helper, and stopping the balancer is required before backup to prevent chunk migrations between shards mid-snapshot, which would leave data in an inconsistent state across nodes. Option A (db.stopBalancer()) is wrong because db is the database helper and has no stopBalancer() method - balancer control belongs to the sh namespace, not db. Options B and C (sh.stopServer() / db.stopServer()) are both invalid - neither method exists in MongoDB's shell API, and stopping the entire server would be far too destructive for a pre-backup step.

Memory tip: Think "sh" = sharding, stop the shuffler - the balancer shuffles chunks around the cluster, and you need everything frozen before a backup. sh.stopBalancer() = sharding helper, stop the chunk shuffler.

Topics

#sharded cluster#backup#sh.stopBalancer#balancer

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice