The Mongo database supports replication of data between servers.
The replication is an enhanced master-slave configuration: that is, only one server is active for writes (the master) at a given time. The primary goal of replication is failover and redundancy.
Mongo supports two forms of replication: simple master-slave configurations, and additionally a replica pair concept. Please see the following pages for more details:
Security
When security is enabled, one must configure a user account for the local database that exists on both servers.
The slave-side of a replication connection first looks for a user repl in local.system.users. If present, that user is used to authenticate against the local database on the source side of the connection. If repl user does not exist, the first user object in local.system.users is tried.
The local database works like the admin database: an account for local has access to the entire server.
Diagnostics
Check master status from the mongo shell with:
db.printReplicationInfo()
Check slave status from the mongo shell with:
db.printSlaveReplicationInfo()
Add Comment