Skip to content

Commit adbb46b

Browse files
author
Sam Kleinman
committed
DOCS-189 replsetsyncfrom command and helper documentation
1 parent 0a9c3b2 commit adbb46b

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

source/reference/commands.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,54 @@ Replication
878878

879879
.. slave-ok, admin-only
880880

881+
.. dbcommand:: replSetSyncFrom
882+
883+
.. versionadded:: 2.2
884+
885+
:option host: Specifies the name and port number of the set member
886+
that you want *this* member to sync from. Use
887+
the ``[hostname]:[port]`` form.
888+
889+
:dbcommand:`replSetSyncFrom` allows you to explicitly configure
890+
which host the current :program:`mongod` will pull data from. This
891+
operation may be useful for testing different patterns and in
892+
situations where a set member is not syncing from the host you
893+
want. You may **not** use this command to force a member to sync
894+
from:
895+
896+
- itself.
897+
- an arbiter.
898+
- a member that does not build indexes.
899+
- an unreachable member.
900+
- a :program:`mongod` instance that is not a member of the same
901+
replica set.
902+
903+
If you attempt to sync from a member that is more than 10 seconds
904+
behind the current member, :program:`mongod` will return and log a
905+
warning, but *will* sync from such members.
906+
907+
The command has the following prototype form:
908+
909+
.. code-block:: javascript
910+
911+
{ replSetSyncFrom: "[hostname]:[port]" }
912+
913+
To run the command in the :program:`mongo` shell, use the following
914+
invocation:
915+
916+
.. code-block:: javascript
917+
918+
db.adminCommand( { replSetSyncFrom: "[hostname]:[port]" } )
919+
920+
You may also use the :func:`rs.syncFrom()` helper in the
921+
:program:`mongo` shell, in an operation with the following form:
922+
923+
.. code-block:: javascript
924+
925+
rs.syncFrom([hostname]:[port])
926+
927+
.. slave-ok, admin-only
928+
881929
Geospatial Commands
882930
~~~~~~~~~~~~~~~~~~~
883931

source/reference/javascript.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,17 @@ Replica Sets
19011901
Returns a basic help text for all of the :doc:`replication
19021902
</core/replication>` related shell functions.
19031903

1904+
.. function:: rs.syncFrom()
1905+
1906+
.. versionadded:: 2.2
1907+
1908+
Provides a wrapper around the :dbcommand:`replSetSyncFrom`, which
1909+
allows administrators to configure the member of a replica set that
1910+
the current member will pull data from. Specify the name of the
1911+
member you want to sync from in the form of ``[hostname]:[port]``.
1912+
1913+
See :dbcommand:`replSetSyncFrom` for more details.
1914+
19041915
Native Shell Functions
19051916
----------------------
19061917

0 commit comments

Comments
 (0)