MongoDB Questions and Answers – Cluster Deployment

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

1. The ________ collection stores a document for each change to the metadata of a sharded collection.
a) version
b) changelog
c) settings
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) The local database supports sharded cluster operation
b) The config database is a dependable API, and users should not write data to the config database in the course of normal operation or maintenance
c) Modification of the config database on a functioning system may lead to instability or inconsistent data sets
d) All of the mentioned
View Answer

Answer: c
Explanation: If you must modify the config database, use mongodump to create a full backup of the config database.

3. The _________ collection stores a document for each sharded collection in the cluster.
a) help
b) shards
c) collections
d) all of the mentioned
View Answer

Answer: c
Explanation: Shard keys are immutable and cannot be changed after insertion.

4. You can return a list of the collections, with the following helper ______________
a) show collects
b) show collection
c) show collections
d) all of the mentioned
View Answer

Answer: c
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) Database servers store the metadata for a sharded cluster
b) Always back up the config database before doing any maintenance on the config server
c) The mongos instances cache metadata and use it to route read and write operations to shards
d) None of the mentioned
View Answer

Answer: a
Explanation: The metadata reflects state and organization of the sharded data sets and system.

6. ________ is a string that holds the address of the client, a mongos instance that initiates this change.
a) config.changelog.serverAddr
b) config.changelog.clientAddr
c) config.changelog.time
d) all of the mentioned
View Answer

Answer: b
Explanation: config.changelog.time is ISODate timestamp that reflects when the change occurred.

Note: Join free Sanfoundry classes at Telegram or Youtube

7. The _______ collection keeps track of the active components in the sharded cluster.
a) deploys
b) lockpings
c) locks
d) all of the mentioned
View Answer

Answer: b
Explanation: The locks collection stores a distributed lock.

8. If the collection is empty then MongoDB will create the index as part of the ________
a) shardCollectionkey()
b) shardCollection()
c) keyCollection()
d) all of the mentioned
View Answer

Answer: b
Explanation: MongoDB provides no method to deactivate sharding for a collection after calling shardCollection.

advertisement

9. Changing the _______ option will change the port that mongod listens for incoming connections on.
a) –shardsrvkey
b) –shardsrv
c) –shard
d) All of the mentioned
View Answer

Answer: b
Explanation: The single-shard cluster is now a non-sharded replica set that will accept read and write operations on the data set.

10. The _____________ collection holds documents for each tagged shard key range in the cluster.
a) tags
b) databases
c) version
d) none of the mentioned
View Answer

Answer: a
Explanation: The version collection holds the current metadata version number.

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.