- Replication >
- Replication Reference >
- The
localDatabase
The local Database¶
On this page
Overview¶
Every mongod instance has its own local database, which
stores data used in the replication process, and other
instance-specific data. The local database is invisible to
replication: collections in the local database are not replicated.
In replication, the local database store stores internal replication
data for each member of a replica set. The local stores the
following collections:
Changed in version 2.4: When running with authentication (i.e. auth),
authenticating to the local database is not equivalent to
authenticating to the admin database. In previous versions,
authenticating to the local database provided access to all databases.
Collection on all mongod Instances¶
-
local.startup_log¶ On startup, each
mongodinstance inserts a document intostartup_logwith diagnostic information about themongodinstance itself and host information.startup_logis a capped collection. This information is primarily useful for diagnostic purposes.Example
Consider the following prototype of a document from the
startup_logcollection:Documents in the
startup_logcollection contain the following fields:-
local.startup_log._id¶ Includes the system hostname and a millisecond epoch value.
-
local.startup_log.hostname¶ The system’s hostname.
-
local.startup_log.startTimeLocal¶ A string that reports the
startTimein the system’s local time zone.
-
local.startup_log.pid¶ The process identifier for this process.
-
Collections on Replica Set Members¶
-
local.system.replset¶ local.system.replsetholds the replica set’s configuration object as its single document. To view the object’s configuration information, issuers.conf()from themongoshell. You can also query this collection directly.
-
local.oplog.rs¶ local.oplog.rsis the capped collection that holds the oplog. You set its size at creation using theoplogSizesetting. To resize the oplog after replica set initiation, use the Change the Size of the Oplog procedure. For additional information, see the Oplog Size section.
-
local.replset.minvalid¶ This contains an object used internally by replica sets to track replication status.
-
local.slaves¶ This contains information about each member of the set and the latest point in time that this member has synced to. If this collection becomes out of date, you can refresh it by dropping the collection and allowing MongoDB to automatically refresh it during normal replication: