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
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
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
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
Explanation: To access the config database, connect to a mongos instance in a sharded cluster, and use the following helper: use config
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
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
Explanation: sh.splitFind() creates two roughly equal chunks.
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
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
Explanation: It may be beneficial to pre-split manually an empty collection using methods such as sh.splitFind().
9. The mergeChunks command requires at least _______ empty input chunk.
a) one
b) two
c) three
d) all of the mentioned
View Answer
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
Explanation: Modifying the chunk size has several limitations.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Check Information Technology Books
- Check MongoDB Books
- Practice Programming MCQs
- Apply for Programming Internship