发布于 2015-09-14 15:10:47 | 172 次阅读 | 评论: 0 | 来源: 网络整理

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.

When running with authentication (i.e. auth), authenticating against the local database is equivalent to authenticating against the admin database. This authentication gives access to all databases.

In replication, the local database store stores internal replication data for each member of a replica set. The local database contains the following collections used for replication:

Collections on Replica Set Members

local.system.replset

local.system.replset holds the replica set’s configuration object as its single document. To view the object’s configuration information, issue rs.conf() from the mongo shell. You can also query this collection directly.

local.oplog.rs

local.oplog.rs is the capped collection that holds the oplog. You set its size at creation using the oplogSize setting. To resize the oplog after replica set initiation, use the 更改Oplog大小 procedure. For additional information, see the Oplog Internals topic in this document and the Oplog topic in the 副本集基本概念 document.

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:

db.getSiblingDB("local").slaves.drop()

Collections used in Master/Slave Replication

In master/slave replication, the local database contains the following collections:

  • On the master:

    local.oplog.$main

    This is the oplog for the master-slave configuration.

    local.slaves

    This contains information about each slave.

  • On each slave:

    local.sources

    This contains information about the slave’s master server.

最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务