MongoDB Questions and Answers – Sharded Cluster Maintenance

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

1. Split empty chunks in your collection by manually performing the ______ command on chunks.
a) distrbute
b) split
c) change
d) all of the mentioned
View Answer

Answer: b
Explanation: The config database is internal: applications and administrators should not modify or depend upon its content in the course of normal operation.

2. Point out the correct statement.
a) Pre-splitting the chunk ranges in an empty sharded collection allows clients to insert data into an already partitioned collection
b) MongoDB cannot create enough chunks or distribute data fast enough to support required throughput
c) Chunk migration does not require copying all the data in the chunk from one shard to another
d) All of the mentioned
View Answer

Answer: a
Explanation: In most situations a sharded cluster will create and distribute chunks automatically without user intervention.

3. MongoDB provides the _________ command to combine contiguous chunk ranges into a single chunk.
a) helpchunks
b) moveChunks
c) mergeChunks
d) all of the mentioned
View Answer

Answer: c
Explanation: For a sharded collection, mergeChunks combines contiguous chunk ranges on a shard into a single chunk. Issue the mergeChunks command from a mongos instance.

4. Use ________ to determine the current chunk ranges across the cluster.
a) sh.collects()
b) sh.status()
c) sh.results()
d) all of the mentioned
View Answer

Answer: b
Explanation: To access the config database, connect to a mongos instance in a sharded cluster, and use the following helper: use config

advertisement
advertisement

5. Point out the wrong statement.
a) If a collection already has data, MongoDB automatically splits the collection’s data when you enable sharding for the collection
b) Subsequent attempts to manually create splits can lead to unpredictable chunk ranges and sizes as well as inefficient or ineffective balancing behavior
c) MongoDB creates splits only after an insert operation
d) None of the mentioned
View Answer

Answer: d
Explanation: The default behavior suppresses the detailed chunk information if the total number of chunks is greater than or equal to 20.

6. __________ splits the chunk that contains the shard key value specified by the query at the chunk’s median point.
a) sh.Find()
b) sh.splitFind()
c) sh.split()
d) all of the mentioned
View Answer

Answer: b
Explanation: sh.splitFind() creates two roughly equal chunks.

Note: Join free Sanfoundry classes at Telegram or Youtube

7. _________ splits a chunk at the shard key value specified by the query.
a) sh.Find()
b) sh.splitFind()
c) sh.split()
d) sh.splitAt
View Answer

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

8. sh.splitFind () Splits the chunk that contains the shard key value specified by the query at the chunk’s ______ point.
a) smean
b) stdev
c) median
d) all of the mentioned
View Answer

Answer: c
Explanation: It may be beneficial to pre-split manually an empty collection using methods such as sh.splitFind().

advertisement

9. The mergeChunks command requires at least _______ empty input chunk.
a) one
b) two
c) three
d) all of the mentioned
View Answer

Answer: a
Explanation: MergeChunks merge two contiguous chunks on the same shard, where at least one of the contains no data.

10. The chunkSize and ________ options, passed at startup to the mongos, do not affect the chunk size after you have initialized the cluster.
a) –Size
b) –chunkSize
c) –chunk
d) None of the mentioned
View Answer

Answer: b
Explanation: Modifying the chunk size has several limitations.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.