Skip to content

DOCS-502 migrated the local db topic to replication internals #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 26, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 71 additions & 1 deletion source/core/replication-internals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,69 @@ 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 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
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 :term:`replica set`. The ``local`` database contains the
following collections used for replication:

.. 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:: 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
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.

.. data:: local.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:

.. data:: local.oplog.$main

This is the oplog for the master-slave configuration.

.. data:: local.slaves

This contains information about each slave.

- On each slave:

.. data:: local.sources

This contains information about the slave's master server.

.. index:: replica set; oplog
.. _replica-set-internals-oplog:

Oplog
-----

Expand Down Expand Up @@ -49,6 +109,8 @@ operations require idempotency:
Data Integrity
--------------

.. index:: replica set; read preferences

Read Preferences
~~~~~~~~~~~~~~~~

Expand All @@ -71,6 +133,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
Expand Down Expand Up @@ -105,6 +168,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
--------

Expand Down Expand Up @@ -211,6 +276,8 @@ aware of the following conditions and possible situations:
:ref:`replica-set-node-priority-configuration`, and
:data:`replica configuration <members[n].votes>`.

.. index:: replica set; network partitions
.. index:: replica set; elections
.. _replica-set-elections-and-network-partitions:

Elections and Network Partitions
Expand All @@ -226,6 +293,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
-------

Expand Down