Skip to content

DOCS-246 changes to change-oplog-size.txt #224

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 13, 2012
Merged
Show file tree
Hide file tree
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
67 changes: 25 additions & 42 deletions source/administration/replica-sets.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ suggestions for administers of replica sets.
The following tutorials provide task-oriented instructions for
specific administrative tasks related to replica set operation.

- :doc:`/tutorial/deploy-replica-set`
- :doc:`/tutorial/expand-replica-set`
- :doc:`/tutorial/change-hostnames-in-a-replica-set`
- :doc:`/tutorial/change-oplog-size`
- :doc:`/tutorial/convert-replica-set-to-replicated-shard-cluster`
- :doc:`/tutorial/convert-secondary-into-arbiter`
- :doc:`/tutorial/deploy-geographically-distributed-replica-set`
- :doc:`/tutorial/deploy-replica-set`
- :doc:`/tutorial/expand-replica-set`

.. _replica-set-node-configurations:
.. _replica-set-member-configurations:
Expand Down Expand Up @@ -57,8 +60,8 @@ configurations.
.. _replica-set-secondary-only-members:
.. _replica-set-secondary-only-configuration:

Secondary-Only
~~~~~~~~~~~~~~
Secondary-Only Members
~~~~~~~~~~~~~~~~~~~~~~

The secondary-only configuration prevents a :term:`secondary` member in a
:term:`replica set` from ever becoming a :term:`primary` in a
Expand Down Expand Up @@ -119,8 +122,8 @@ This sets the following:
.. _replica-set-hidden-members:
.. _replica-set-hidden-configuration:

Hidden
~~~~~~
Hidden Members
~~~~~~~~~~~~~~

Hidden members are part of a replica set but cannot become
primary and are invisible to client applications. *However,*
Expand Down Expand Up @@ -164,8 +167,8 @@ other members in the set will not advertise the hidden member in the
.. _replica-set-delayed-members:
.. _replica-set-delayed-configuration:

Delayed
~~~~~~~
Delayed Members
~~~~~~~~~~~~~~~

Delayed members copy and apply operations from the primary's :term:`oplog` with
a specified delay. If a member has a delay of one hour, then
Expand Down Expand Up @@ -220,12 +223,10 @@ queries in normal operations.
<members[n].slaveDelay>` window, the delayed member cannot
successfully replicate operations.

.. see:: For more information about delayed members, see the
section on :ref:`Delayed Replication <replica-set-delayed-members>`.
Additionally consider the following resources:
:data:`members[n].slaveDelay`, :ref:`Replica Set Reconfiguration
<replica-set-reconfiguration-usage>`, :ref:`Oplog Sizing
<replica-set-oplog-sizing>`, and :doc:`/tutorial/change-oplog-size`.
.. seealso:: :data:`members[n].slaveDelay`, :ref:`Replica Set Reconfiguration
<replica-set-reconfiguration-usage>`, :ref:`replica-set-oplog-sizing`,
:ref:`replica-set-procedure-change-oplog-size` in this document,
and the :doc:`/tutorial/change-oplog-size` tutorial.

.. index:: replica set members; arbiters
.. _replica-set-arbiters:
Expand Down Expand Up @@ -289,8 +290,8 @@ hostname and the port.
.. _replica-set-non-voting-members:
.. _replica-set-non-voting-configuration:

Non-Voting
~~~~~~~~~~
Non-Voting Members
~~~~~~~~~~~~~~~~~~

You may choose to change the number of votes that each member has in
:ref:`elections <replica-set-elections>` for :term:`primary`. In general, all
Expand Down Expand Up @@ -492,30 +493,11 @@ of the member with the highest :data:`members[n].priority` setting.
Changing Oplog Size
~~~~~~~~~~~~~~~~~~~

The :term:`oplog` exists internally as a :term:`capped collection`, so
you cannot modify its size in the course of normal operations. In most
cases the :ref:`default oplog size <replica-set-oplog-sizing>` is an
acceptable size; however, in some situations you may need a larger or
smaller oplog. To resize the oplog, follow these steps:

#. Restart the current :term:`primary` instance in the :term:`replica set` in
"standalone" mode, running on a different port.

#. Save the last entry from the old (current) oplog and create a
backup of the oplog.

#. Drop the existing oplog and create a new oplog of a different size.

#. Insert the previously saved last entry from the old oplog into the
new oplog.

#. Restart the server as a member of the replica set on its usual
port.
The following is an overview of the procedure for changing the size of the oplog:

#. Apply this procedure to any other member of the replica set that
*could become* primary.
.. include:: /includes/procedure-change-oplog-size.rst

.. seealso:: The :doc:`/tutorial/change-oplog-size` tutorial.
For a detailed procedure, see :doc:`/tutorial/change-oplog-size`.

.. _replica-set-security:

Expand Down Expand Up @@ -657,10 +639,11 @@ Possible causes of replication lag include:

For more information see:

- the :ref:`Replication Write Concern <replica-set-write-concern>` section,
- the :ref:`replica-set-oplog` documentation,
- the :ref:`Oplog Sizing <replica-set-oplog-sizing>` section, and
- the :doc:`/tutorial/change-oplog-size` tutorial.
- :ref:`replica-set-write-concern`.
- The :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` document.
- The :ref:`replica-set-oplog` topic in the :doc:`/core/replication-internals` document.
- The :ref:`replica-set-procedure-change-oplog-size` topic this document.
- The :doc:`/tutorial/change-oplog-size` tutorial.

.. index:: pair: replica set; failover
.. _replica-set-failover-administration:
Expand Down
2 changes: 1 addition & 1 deletion source/core/replication-internals.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ troubleshooting and for further understanding MongoDB's behavior and approach.
Oplog
-----

For an explanation of the oplog, see the :ref:`oplog <replica-set-oplog-sizing>`
For an explanation of the oplog, see the :ref:`replica-set-oplog-sizing`
topic in the :doc:`/core/replication` document.

Under various exceptional
Expand Down
20 changes: 9 additions & 11 deletions source/core/replication.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ on the :term:`primary` and then records the operations on the primary's
oplog. The :term:`secondary` members then replicate this log and apply
the operations to themselves in an asynchronous process. All replica set
members contain a copy of the oplog, allowing them to maintain the
current state of the database.
current state of the database. The oplog is an :term:`idempotent` log.

By default, the size of the oplog is as follows:

Expand All @@ -297,16 +297,14 @@ By default, the size of the oplog is as follows:

Before oplog creation, you can specify the size of your oplog with the
:setting:`oplogSize` option. Once the oplog is created, you can only
change the size of the oplog by using the :ref:`oplog resizing procedure
<replica-set-procedure-change-oplog-size>`.

.. QUESTION: SK, Can the next graph be rewritten? It's unclear to me. BG

For example, if an oplog fits 24 hours of operations, then members can
stop copying entries from the oplog for 24 hours before they require
full resyncing *and* the disk will be full in 19 days. If this were
the case, you would have a very high-volume member. In many
circumstances, the default oplog can hold days of operations.
change the size of the oplog by using the :doc:`/tutorial/change-oplog-size` tutorial.

In most cases, the default oplog size is sufficient. For example, if an
oplog that is 5% of free disk space fills up in 24 hours of operations, then
secondaries can stop copying entries from the oplog for 24 hours before
they require full resyncing. This example describes a
very high-volume member. In many circumstances, the default oplog can
hold days of operations.

The following factors affect how MongoDB uses space in the oplog:

Expand Down
20 changes: 20 additions & 0 deletions source/includes/procedure-change-oplog-size.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
1. Shut down the current :term:`primary` instance in the
:term:`replica set` and then restart it on a different port
and in "standalone" mode.

#. Create a backup of the old (current) oplog. This is optional.

#. Save the last entry from the old oplog.

#. Drop the old oplog.

#. Create a new oplog of a different size.

#. Insert the previously saved last entry from the old oplog into the
new oplog.

#. Restart the server as a member of the replica set on its usual
port.

#. Apply this procedure to any other member of the replica set that
*could become* primary.
Loading