From e2f21a74bd6e643cb1c16838c918201f28809580 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Fri, 21 Sep 2012 17:54:17 -0400 Subject: [PATCH 1/5] DOCS-502 migrated the local db topic to replication internals --- source/core/replication-internals.txt | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index a2096683d9d..8d5cf2d5bb5 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -15,6 +15,58 @@ troubleshooting and for further understanding MongoDB's behavior and approach. .. index:: replica set; oplog .. _replica-set-oplog: +The "Local" Database +-------------------- + +The "local" database exists on every :program:`mongod` instance and is +used to store any collections that should be local to the instance. The +local database is never replicated. + +When authentication is used, authenticating against the local database +is equivalent to authenticating against the admin database. It gives you +permissions across all databases, not just local. + +In replication, the local database is used to store internal replication +data for each member of a replica set. The local database contains the +following collections used for replication: + +- **system.replset**: This stores the replica set's configuration + object. To view the object's configuration information, issue + :method:`rs.conf()` from the :program:`mongo` shell. You can also + query this collection directly. + +- **oplog.rs**: This is the capped collection that is the :term:`oplog`. + You set its size at creation using the :setting:`oplogSize` setting. + To change its size once it has been created, see + :doc:`/tutorial/change-oplog-size`. For additional information, see + the :ref:`replica-set-internals-oplog` topic in this document and the + :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` + document. + +- **replset.minvalid**: This contains an object used internally by + replica sets to track sync status. + +In master/slave replication, the local database contains the following +collections: + +- On the master: + + - oplog.$main. This is the oplog. + + - slaves + +- On each slave: + + - sources + +The local database also can include these collections: + +- me + +- pair.*. This is for replica pairs, which are deprecated. + +.. _replica-set-internals-oplog: + Oplog ----- From 1e8852948f04a073b7e9b73c6ee25eaed80e6be5 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Fri, 21 Sep 2012 18:05:50 -0400 Subject: [PATCH 2/5] DOCS-502 moved some info off page and into a comment --- source/core/replication-internals.txt | 31 +++++++++++---------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 8d5cf2d5bb5..583cc76d5b8 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -19,7 +19,7 @@ The "Local" Database -------------------- The "local" database exists on every :program:`mongod` instance and is -used to store any collections that should be local to the instance. The +used to store any collections that are local only to the instance. The local database is never replicated. When authentication is used, authenticating against the local database @@ -46,24 +46,17 @@ following collections used for replication: - **replset.minvalid**: This contains an object used internally by replica sets to track sync status. -In master/slave replication, the local database contains the following -collections: - -- On the master: - - - oplog.$main. This is the oplog. - - - slaves - -- On each slave: - - - sources - -The local database also can include these collections: - -- me - -- pair.*. This is for replica pairs, which are deprecated. +.. TODO do we want to include this information + In master/slave replication, the local database contains the + following collections: + - On the master: + - oplog.$main. This is the oplog. + - slaves + - On each slave: + - sources + The local database also can include these collections: + - me + - pair.*. This is for replica pairs, which are deprecated. .. _replica-set-internals-oplog: From 4cb6736afa61a5338a374beec303128672356ee4 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Mon, 24 Sep 2012 18:47:47 -0400 Subject: [PATCH 3/5] DOCS-502 added info about master-slave collections --- source/core/replication-internals.txt | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 583cc76d5b8..549749dd19d 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -20,14 +20,14 @@ The "Local" Database The "local" database exists on every :program:`mongod` instance and is used to store any collections that are local only to the instance. The -local database is never replicated. +"local" database is never replicated. -When authentication is used, authenticating against the local database +When authentication is used, authenticating against the "local" database is equivalent to authenticating against the admin database. It gives you permissions across all databases, not just local. -In replication, the local database is used to store internal replication -data for each member of a replica set. The local database contains the +In replication, the "local" database is used to store internal replication +data for each member of a :term:`replica set`. The "local" database contains the following collections used for replication: - **system.replset**: This stores the replica set's configuration @@ -46,15 +46,25 @@ following collections used for replication: - **replset.minvalid**: This contains an object used internally by replica sets to track sync status. +In :term:`master`-:term:`slave` replication, the "local" database contains +the following collections: + +.. note:: In MongoDB versions 1.6 and higher, use replica sets instead + of the master-slave configuration. Replica sets are a functional + superset of master-slave and are more robust. + +- On the master: + + - **oplog.$main**: This is the oplog for the master-slave configuration. + + - **slaves**: This contains information about each slave. + +- On each slave: + + - **sources**: This contains information about the slave's master server. + .. TODO do we want to include this information - In master/slave replication, the local database contains the - following collections: - - On the master: - - oplog.$main. This is the oplog. - - slaves - - On each slave: - - sources - The local database also can include these collections: + The "local" database also can include these collections: - me - pair.*. This is for replica pairs, which are deprecated. From 493ab19f8fd5a1b73169ceaff5ed71dec9fdc602 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Tue, 25 Sep 2012 16:56:31 -0400 Subject: [PATCH 4/5] DOCS-502 edits per review comments --- source/core/replication-internals.txt | 92 +++++++++++++++++---------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 549749dd19d..33aa86d5f26 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -12,62 +12,78 @@ operation of :term:`replica set` features. This material is not necessary for normal operation or application development but may be useful for troubleshooting and for further understanding MongoDB's behavior and approach. -.. index:: replica set; oplog +.. index:: replica set; local database .. _replica-set-oplog: -The "Local" Database --------------------- +The Local Database +------------------ -The "local" database exists on every :program:`mongod` instance and is -used to store any collections that are local only to the instance. The -"local" database is never replicated. +The ``local`` database exists on every :program:`mongod` instance and +stores replication data specific to that instance. The ``local`` +database is invisible to replication. The collections in the ``local`` +database are not replicated. -When authentication is used, authenticating against the "local" database +When authentication is used, authenticating against the ``local`` database is equivalent to authenticating against the admin database. It gives you -permissions across all databases, not just local. +permissions across all databases, not just ``local``. -In replication, the "local" database is used to store internal replication -data for each member of a :term:`replica set`. The "local" database contains the +In replication, the ``local`` database is used to store internal replication +data for each member of a :term:`replica set`. The ``local`` database contains the following collections used for replication: -- **system.replset**: This stores the replica set's configuration - object. To view the object's configuration information, issue - :method:`rs.conf()` from the :program:`mongo` shell. You can also - query this collection directly. +.. data:: system.replset -- **oplog.rs**: This is the capped collection that is the :term:`oplog`. - You set its size at creation using the :setting:`oplogSize` setting. - To change its size once it has been created, see - :doc:`/tutorial/change-oplog-size`. For additional information, see - the :ref:`replica-set-internals-oplog` topic in this document and the - :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` - document. + This stores the replica set's configuration object. To view the + object's configuration information, issue :method:`rs.conf()` from + the :program:`mongo` shell. You can also query this collection + directly. -- **replset.minvalid**: This contains an object used internally by - replica sets to track sync status. +.. data:: oplog.rs -In :term:`master`-:term:`slave` replication, the "local" database contains -the following collections: + This is the capped collection that is the :term:`oplog`. You set its + size at creation using the :setting:`oplogSize` setting. To change + its size once it has been created, see + :doc:`/tutorial/change-oplog-size`. For additional information, see + the :ref:`replica-set-internals-oplog` topic in this document and the + :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` + document. -.. note:: In MongoDB versions 1.6 and higher, use replica sets instead - of the master-slave configuration. Replica sets are a functional - superset of master-slave and are more robust. +.. data:: replset.minvalid + + This contains an object used internally by replica sets to track sync + status. + +In :term:`master`-:term:`slave` replication, the ``local`` database contains +the following collections: - On the master: - - **oplog.$main**: This is the oplog for the master-slave configuration. + .. data:: oplog.$main - - **slaves**: This contains information about each slave. + This is the oplog for the master-slave configuration. + + .. data:: slaves + + This contains information about each slave. - On each slave: - - **sources**: This contains information about the slave's master server. + .. data:: sources + + This contains information about the slave's master server. + +.. note:: In MongoDB versions 1.6 and higher, use replica sets instead + of the master-slave configuration. + +.. note:: + + The local database also can include these collections: -.. TODO do we want to include this information - The "local" database also can include these collections: - me + - pair.*. This is for replica pairs, which are deprecated. +.. index:: replica set; oplog .. _replica-set-internals-oplog: Oplog @@ -104,6 +120,8 @@ operations require idempotency: Data Integrity -------------- +.. index:: replica set; read preferences + Read Preferences ~~~~~~~~~~~~~~~~ @@ -126,6 +144,7 @@ secondaries may not always reflect the latest writes to the output to asses the current state of replication and determine if there is any unintended replication delay. +.. index:: replica set; configurations .. _replica-set-member-configurations-internals: Member Configurations @@ -160,6 +179,8 @@ for your data set is crucial. .. seealso:: The :ref:`replica-set-member-configurations` topic in the :doc:`/administration/replica-sets` document. +.. index:: replica set; security + Security -------- @@ -266,6 +287,8 @@ aware of the following conditions and possible situations: :ref:`replica-set-node-priority-configuration`, and :data:`replica configuration `. +.. index:: replica set; network partitions +.. index:: replica set; elections .. _replica-set-elections-and-network-partitions: Elections and Network Partitions @@ -281,6 +304,9 @@ partition has a majority on its own, the set will not elect a new primary and the set will become read only. The best practice is to have and a majority of servers in one data center and one server in another. +.. index:: replica set; sync + + Syncing ------- From b965842ec1e1359cf1d8878816256b6ed8b11422 Mon Sep 17 00:00:00 2001 From: Bob Grabar Date: Tue, 25 Sep 2012 17:04:32 -0400 Subject: [PATCH 5/5] DOCS-502 edits per review comments redux --- source/core/replication-internals.txt | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/source/core/replication-internals.txt b/source/core/replication-internals.txt index 33aa86d5f26..2e937b6dfdd 100644 --- a/source/core/replication-internals.txt +++ b/source/core/replication-internals.txt @@ -31,14 +31,14 @@ In replication, the ``local`` database is used to store internal replication data for each member of a :term:`replica set`. The ``local`` database contains the following collections used for replication: -.. data:: system.replset +.. data:: local.system.replset This stores the replica set's configuration object. To view the object's configuration information, issue :method:`rs.conf()` from the :program:`mongo` shell. You can also query this collection directly. -.. data:: oplog.rs +.. data:: local.oplog.rs This is the capped collection that is the :term:`oplog`. You set its size at creation using the :setting:`oplogSize` setting. To change @@ -48,7 +48,7 @@ following collections used for replication: :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` document. -.. data:: replset.minvalid +.. data:: local.replset.minvalid This contains an object used internally by replica sets to track sync status. @@ -58,31 +58,20 @@ the following collections: - On the master: - .. data:: oplog.$main + .. data:: local.oplog.$main This is the oplog for the master-slave configuration. - .. data:: slaves + .. data:: local.slaves This contains information about each slave. - On each slave: - .. data:: sources + .. data:: local.sources This contains information about the slave's master server. -.. note:: In MongoDB versions 1.6 and higher, use replica sets instead - of the master-slave configuration. - -.. note:: - - The local database also can include these collections: - - - me - - - pair.*. This is for replica pairs, which are deprecated. - .. index:: replica set; oplog .. _replica-set-internals-oplog: