This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Replication Maintenance”.
1. _________ shut down the mongod instance for one of the non-primary members of your replica set.
a) db.shutdown()
b) db.shutdownServer()
c) db.shutServer()
d) all of the mentioned
View Answer
Explanation: Restart this mongod as a standalone instance running on a different port and without the –replSet parameter.
2. Point out the wrong statement.
a) To change the size of the oplog, you must perform maintenance on each member of the replica set in turn
b) Always start rolling replica set maintenance with the secondaries, and finish with the maintenance on primary member
c) The oplog exists internally as a capped collection
d) None of the mentioned
View Answer
Explanation: In most cases the default oplog size is an acceptable size; however, in some situations you may need a larger or smaller oplog.
3. To finish the rolling maintenance operation, step down the primary with the _________ method.
a) rs.syncFrom()
b) rs.stepDown()
c) rs.synchrepl()
d) secondary
View Answer
Explanation: The replica set member will recover and “catch up” before it is eligible for election to primary.
4. You also can force a member never to become primary by setting its priority value to ___________
a) 1
b) 2
c) 3
d) 0
View Answer
Explanation: You can force a replica set member to become primary by giving it a higher priority value than any other member in the set.
5. Point out the correct statement.
a) Replica sets allow a MongoDB deployment to remain available during the majority of a maintenance window
b) Always start mongod with the same user, even when restarting a replica set member as a standalone instance
c) The secondary takes time to catch up to the primary
d) All of the mentioned
View Answer
Explanation: From the mongo shell, use the rs.status() command to verify that the member has caught up from the RECOVERING state to the SECONDARY state.
6. A replica set member becomes _________ when its replication process falls so far behind that the primary overwrites oplog entries the member has not yet replicated.
a) stale
b) state
c) dead
d) secondary
View Answer
Explanation: When this occurs, you must completely resynchronize the member by removing its data and performing an initial sync.
7. During initial sync, mongod will remove the content of the _______
a) dbPathSync
b) Path
c) dbPath
d) none of the mentioned
View Answer
Explanation: You can also force a mongod that is already a member of the set to perform initial sync by restarting the instance without the content of the dbPath.
8. You cannot use a _________backup for the data files, only a snapshot backup.
a) mongorestore
b) mongodump
c) bsondump
d) rs.syncFrom()
View Answer
Explanation: If copying data files, you must copy the content of the local database.
9. You can use the ________ setting in Replica Set Configuration to disable chained replication for situations where chained replication is causing lag.
a) chainingAllowed
b) chainingDisAllowed
c) chainingAllow
d) none of the mentioned
View Answer
Explanation: MongoDB enables chained replication by default.
10. For most replica sets, the hostnames in the _________ field never change.
a) tag
b) host
c) rs
d) none of the mentioned
View Answer
Explanation: Always use resolvable hostnames for the value of the host field in the replica set configuration to avoid confusion and complexity.
Sanfoundry Global Education & Learning Series – MongoDB.
Here’s the list of Best Books in MongoDB.
- Get Free Certificate of Merit in MongoDB
- Participate in MongoDB Certification Contest
- Become a Top Ranker in MongoDB
- Take MongoDB Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Buy MongoDB Books
- Apply for Programming Internship
- Apply for MongoDB Internship
- Buy Information Technology Books
- Practice Programming MCQs