From adbb46b8d25945cae863af8eb14511df665f3648 Mon Sep 17 00:00:00 2001 From: Sam Kleinman Date: Wed, 11 Jul 2012 11:24:19 -0400 Subject: [PATCH] DOCS-189 replsetsyncfrom command and helper documentation --- source/reference/commands.txt | 48 +++++++++++++++++++++++++++++++++ source/reference/javascript.txt | 11 ++++++++ 2 files changed, 59 insertions(+) diff --git a/source/reference/commands.txt b/source/reference/commands.txt index 2b968f9e3c7..ac600869cf4 100644 --- a/source/reference/commands.txt +++ b/source/reference/commands.txt @@ -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 ~~~~~~~~~~~~~~~~~~~ diff --git a/source/reference/javascript.txt b/source/reference/javascript.txt index 8cd49377ae2..aed1e2d1aa4 100644 --- a/source/reference/javascript.txt +++ b/source/reference/javascript.txt @@ -1901,6 +1901,17 @@ Replica Sets Returns a basic help text for all of the :doc:`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 ----------------------