Skip to content

DOCS-189 replsetsyncfrom command and helper documentation #60

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 1 commit into from
Jul 11, 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
48 changes: 48 additions & 0 deletions source/reference/commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,54 @@ Replication

.. slave-ok, admin-only

.. dbcommand:: replSetSyncFrom

.. versionadded:: 2.2

:option host: Specifies the name and port number of the set member
that you want *this* member to sync from. Use
the ``[hostname]:[port]`` form.

:dbcommand:`replSetSyncFrom` allows you to explicitly configure
which host the current :program:`mongod` will pull data from. This
operation may be useful for testing different patterns and in
situations where a set member is not syncing from the host you
want. You may **not** use this command to force a member to sync
from:

- itself.
- an arbiter.
- a member that does not build indexes.
- an unreachable member.
- a :program:`mongod` instance that is not a member of the same
replica set.

If you attempt to sync from a member that is more than 10 seconds
behind the current member, :program:`mongod` will return and log a
warning, but *will* sync from such members.

The command has the following prototype form:

.. code-block:: javascript

{ replSetSyncFrom: "[hostname]:[port]" }

To run the command in the :program:`mongo` shell, use the following
invocation:

.. code-block:: javascript

db.adminCommand( { replSetSyncFrom: "[hostname]:[port]" } )

You may also use the :func:`rs.syncFrom()` helper in the
:program:`mongo` shell, in an operation with the following form:

.. code-block:: javascript

rs.syncFrom([hostname]:[port])

.. slave-ok, admin-only

Geospatial Commands
~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 11 additions & 0 deletions source/reference/javascript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,17 @@ Replica Sets
Returns a basic help text for all of the :doc:`replication
</core/replication>` related shell functions.

.. function:: rs.syncFrom()

.. versionadded:: 2.2

Provides a wrapper around the :dbcommand:`replSetSyncFrom`, which
allows administrators to configure the member of a replica set that
the current member will pull data from. Specify the name of the
member you want to sync from in the form of ``[hostname]:[port]``.

See :dbcommand:`replSetSyncFrom` for more details.

Native Shell Functions
----------------------

Expand Down