MongoDB Questions and Answers – Troubleshooting Sharded Cluster

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Troubleshooting Sharded Cluster”.

1. The preferred way to clear the _________ flag from a chunk is to attempt to split the chunk.
a) boolean
b) jumbo
c) change
d) all of the mentioned
View Answer

Answer: b
Explanation: If the chunk is divisible, MongoDB removes the flag upon successful split of the chunk.

2. Point out the correct statement.
a) In some instances, MongoDB cannot split the no-longer jumbo chunk, such as a chunk with a range of single shard key value
b) To ensure that mongos instances update their cluster information cache, run flushConfig in the admin database
c) In a sharded cluster, you cannot use tags to associate specific ranges of a shard key with a specific shard or subset of shards
d) All of the mentioned
View Answer

Answer: a
Explanation: If you clear the jumbo flag for a chunk that still exceeds the chunk size and/or the document number limit, MongoDB will re-label the chunk as jumbo when MongoDB tries to move the chunk.

3. _________ is used to remove tags from a particular shard.
a) sh.removeTag()
b) sh.removeShard()
c) sh.removeShardTag()
d) all of the mentioned
View Answer

Answer: c
Explanation: You may remove tags from a particular shard using the sh.removeShardTag() method when connected to a mongos instance.

4. ________ associates a shard with a tag or identifier.
a) sh.collects()
b) sh.addShardTag
c) sh.results()
d) all of the mentioned
View Answer

Answer: b
Explanation: MongoDB uses these identifiers to direct chunks that fall within a tagged range to specific shards.

advertisement
advertisement

5. Point out the wrong statement.
a) You cannot overlap defined ranges, or tag the same range more than once
b) The mongod provides a helper for removing a tag range
c) The output from sh.status() lists tags associated with a shard, if any, for each shard
d) None of the mentioned
View Answer

Answer: b
Explanation: The mongod does not provide a helper for removing a tag range.

6. To assign a tag to a range of shard keys use the _________ method when connected to a mongos instance.
a) sh.addTagRange()
b) sh.splitFind()
c) sh.Range()
d) all of the mentioned
View Answer

Answer: a
Explanation: You may delete tag assignment from a shard key range by removing the corresponding document from the tags collection of the config database.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. Each document in the tags holds the ________ of the sharded collection and a minimum shard key value.
a) tag
b) chunk
c) namespace
d) size
View Answer

Answer: c
Explanation: In most circumstances, you should leave chunk splitting to the automated processes within MongoDB.

8. Which of the following parameter represents minimum value of the shard key range to include in the tag?
a) min
b) max
c) maximum
d) minimum
View Answer

Answer: d
Explanation: The minimum is an inclusive match.

advertisement

9. Use ________ to ensure that the balancer migrates documents that exist within the specified range to a specific shard.
a) sh.addShardTag()
b) sh.addTag()
c) sh.aShardTag()
d) all of the mentioned
View Answer

Answer: a
Explanation: Only issue sh.addTagRange() when connected to a mongos instance.

10. Which of the following parameter denotes name of the shard from which to remove a tag?
a) shard
b) tag
c) chunk
d) none of the mentioned
View Answer

Answer: a
Explanation: Shard is of string type.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.