Skip to content

Commit 258c4a6

Browse files
DOCSP-12636 doc for Replica Set Status
1 parent 10bf94a commit 258c4a6

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

source/reference/methods.txt

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,3 +876,90 @@ Role Management Methods
876876
* - :method:`db.updateRole()`
877877

878878
- Updates a user-defined role.
879+
880+
Replication Methods
881+
-------------------
882+
883+
.. list-table::
884+
:widths: 30 70
885+
:header-rows: 1
886+
887+
* - Method
888+
889+
- Description
890+
891+
* - ``rs.printSecondaryReplicationInfo()``
892+
893+
- Returns the status of the secondary members of the replica set. This
894+
is identical to the ``db.printSecondaryReplicationInfo()`` method.
895+
The server :method:`rs.printSlaveReplicationInfo()` method is referred
896+
to as ``rs.printSecondaryReplicationInfo()`` in ``mongosh``.
897+
898+
The following is an example output from the
899+
``rs.printSecondaryReplicationInfo()`` method issued on a replica set with two secondary members:
900+
901+
.. code-block:: sh
902+
:copyable: false
903+
904+
source: rs2.example.net:27017
905+
{
906+
syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
907+
replLag: '0 secs (0 hrs) behind the primary '
908+
}
909+
---
910+
source: rs3.example.net:27017
911+
{
912+
syncedTo: 'Tue Oct 13 2020 09:42:18 GMT-0700 (Pacific Daylight Time)',
913+
replLag: '0 secs (0 hrs) behind the primary '
914+
}
915+
916+
* - ``db.printSecondaryReplicationInfo()``
917+
918+
- Returns the status of the secondary members of the replica set. This
919+
is identical to the ``rs.printSecondaryReplicationInfo()`` method.
920+
The server :method:`db.printSlaveReplicationInfo()` method is referred
921+
to as ``db.printSecondaryReplicationInfo()`` in ``mongosh``.
922+
923+
The following is an example output from the
924+
``rs.printSecondaryReplicationInfo()`` method issued on a replica set with two secondary members:
925+
926+
.. code-block:: sh
927+
:copyable: false
928+
929+
source: rs2.example.net:27017
930+
{
931+
syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
932+
replLag: '0 secs (0 hrs) behind the primary '
933+
}
934+
---
935+
source: rs3.example.net:27017
936+
{
937+
syncedTo: 'Tue Oct 13 2020 09:37:28 GMT-0700 (Pacific Daylight Time)',
938+
replLag: '0 secs (0 hrs) behind the primary '
939+
}
940+
941+
* - :method:`db.getReplicationInfo()`
942+
943+
- Returns the status of the replica set from the oplog data.
944+
945+
* - ``rs.isMaster()``
946+
947+
- Returns the replica set configuration, role, and status for
948+
the ``mongod`` instance that ``mongosh`` is connected to. The ``mongosh`` ``rs.isMaster()`` method is identical to the server :manual:`isMaster </reference/command/isMaster/>` command.
949+
950+
* - :method:`rs.printReplicationInfo()`
951+
952+
- Returns the oplog of the replica set member that ``mongosh`` is
953+
connected to. This is identical to the
954+
:method:`db.printReplicationInfo()` method.
955+
956+
* - :method:`db.printReplicationInfo()`
957+
958+
- Returns the oplog of the replica set member that ``mongosh`` is
959+
connected to. This is identical to the
960+
:method:`rs.printReplicationInfo()` method.
961+
962+
* - :method:`rs.status()`
963+
964+
- Returns the status of the replica set member that ``mongosh`` is
965+
connected to.

0 commit comments

Comments
 (0)