On this page
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.
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.For example, the following is a prototype of a document from the
startup_logcollection:{ "_id" : "<string>", "hostname" : "<string>", "startTime" : ISODate("<date>"), "startTimeLocal" : "<string>", "cmdLine" : { "dbpath" : "<path>", "<option>" : <value> }, "pid" : <number>, "buildinfo" : { "version" : "<string>", "gitVersion" : "<string>", "sysInfo" : "<string>", "loaderFlags" : "<string>", "compilerFlags" : "<string>", "allocator" : "<string>", "versionArray" : [ <num>, <num>, <...> ], "javascriptEngine" : "<string>", "bits" : <number>, "debug" : <boolean>, "maxBsonObjectSize" : <number> } }Documents in the
startup_logcollection contain the following fields:local.startup_log.startTime-
A UTC ISODate value that reflects when the server started.
local.startup_log.startTimeLocal-
A string that reports the
startTimein the system’s local time zone.
local.startup_log.cmdLine-
An embedded document that reports the
mongodruntime options and their values.
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 theoplogSizeMBsetting. 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-
Removed in version 3.0: Replica set members no longer mirror replication status of the set to the
local.slavescollection. Users.status()instead.
Collections used in Master/Slave Replication
In master/slave replication, the local database contains the following collections:
On the master:
local.slaves-
Removed in version 3.0: MongoDB no longer stores information about each slave in the
local.slavescollection. Usedb.serverStatus( { repl: 1 } )instead.
On each slave:
Restrictions
-
Retryable Writes against
local -
You cannot perform write operations to collections in the
localdatabase with retryable writes enabled.The official MongoDB 3.6-compatible drivers disable retryable writes by default. To explicitly disable retryable writes, specify
retryWrites=falsein the connection string for the MongoDB cluster.