Skip to content

DOCS-1474 moved replica-status to replSetGetStatus #958

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

Closed
wants to merge 4 commits into from
Closed
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
8 changes: 8 additions & 0 deletions bin/htaccess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1504,4 +1504,12 @@ type: 'redirect'
code: 303
outputs:
- 'v2.2'
---
redirect-path: '/reference/replica-status'
url-base: '/reference/command/replSetGetStatus'
type: 'redirect'
code: 301
outputs:
- 'after-v2.2'
- 'manual'
...
4 changes: 2 additions & 2 deletions source/administration/monitoring.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ data provided by :dbcommand:`serverStatus`.
``replSetGetStatus``
````````````````````

View the :doc:`replSetGetStatus data </reference/replica-status>` with
View the :doc:`replSetGetStatus data </reference/command/replSetGetStatus>` with
the :dbcommand:`replSetGetStatus` command (:method:`rs.status()` from the
shell). The document returned by
this command reflects the state and configuration of the replica
Expand Down Expand Up @@ -563,7 +563,7 @@ the following helper in the shell:

rs.status()

See the :doc:`/reference/replica-status` document for a more in depth
See the :doc:`/reference/command/replSetGetStatus` document for a more in depth
overview view of this output. In general watch the value of
:data:`~replSetGetStatus.members.optimeDate`. Pay particular attention
to the difference in time between the :term:`primary` and the
Expand Down
2 changes: 1 addition & 1 deletion source/meta/reference.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Status, Monitoring, and Reporting Output
/reference/command/dbStats
/reference/command/connPoolStats
/reference/command/collStats
/reference/replica-status
/reference/command/replSetGetStatus
/reference/exit-codes
/reference/method/db.currentOp

Expand Down
2 changes: 1 addition & 1 deletion source/reference/command/connPoolStats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Output
:term:`shard` in the :term:`replica set`.

These values derive from the :doc:`replica set status
</reference/replica-status>` values.
</reference/command/replSetGetStatus>` values.

.. data:: connPoolStats.replicaSets.[shard].host[n].addr

Expand Down
148 changes: 141 additions & 7 deletions source/reference/command/replSetGetStatus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,157 @@ replSetGetStatus

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't there be a definition heading above?

.. default-domain:: mongodb

Definition
----------

.. dbcommand:: replSetGetStatus

The ``replSetGetStatus`` command returns the status of the replica
set from the point of view of the current server. You must run the
command against the :term:`admin database`. The command has the following
prototype format:
command against the :term:`admin database`. The command has the
following prototype format:

.. code-block:: javascript

{ replSetGetStatus: 1 }

However, you can also run this command from the shell like so:
The value specified does not affect the output of the command. Data
provided by this command derives from data included in heartbeats
sent to the current instance by other members of the replica set.
Because of the frequency of heartbeats, these data can be several
seconds out of date.

.. code-block:: javascript
You can also access this functionality through the
:method:`rs.status()` helper in the :program:`mongo` shell.

The :program:`mongod` must have replication enabled and be a member
of a replica set for the for :dbcommand:`replSetGetStatus` to return
successfully.

Output
------

.. data:: replSetGetStatus.set

The ``set`` value is the name of the replica set, configured in the
:setting:`replSet` setting. This is the same value as
:data:`~local.system.replset._id` in :method:`rs.conf()`.

.. data:: replSetGetStatus.date

The value of the ``date`` field is an :term:`ISODate` of the
current time, according to the current server. Compare this to the
value of the :data:`~replSetGetStatus.members.lastHeartbeat` to find the
operational lag between the current host and the other hosts in the
set.

.. data:: replSetGetStatus.myState

The value of :data:`~replSetGetStatus.myState` reflects state of the current
replica set member. An integer between ``0`` and ``10`` represents
the state of the member. These integers map to states, as described
in the following table:

.. include:: /includes/replica-states.rst

.. data:: replSetGetStatus.members

The ``members`` field holds an array that contains a document for
every member in the replica set.

.. data:: replSetGetStatus.members.name

The ``name`` field holds the name of the server.

.. data:: replSetGetStatus.members.self

The ``self`` field is only included in the document for the
current ``mongod`` instance in the members array. It's value is
``true``.

.. data:: replSetGetStatus.members.errmsg

This field contains the most recent error or status message
received from the member. This field may be empty (e.g. ``""``) in
some cases.

.. data:: replSetGetStatus.members.health

The ``health`` value is only present for the other members of the
replica set (i.e. not the member that returns
:method:`rs.status`.) This field conveys if the member is up (i.e.
``1``) or down (i.e. ``0``.)

.. data:: replSetGetStatus.members.state

The value of the :data:`~replSetGetStatus.members.state` reflects
state of this replica set member. An integer between ``0`` and
``10`` represents the state of the member. These integers map to
states, as described in the following table:

.. include:: /includes/replica-states.rst

.. data:: replSetGetStatus.members.stateStr

A string that describes :data:`~replSetGetStatus.members.state`.

.. data:: replSetGetStatus.members.uptime

The :data:`~replSetGetStatus.members.uptime` field holds a value
that reflects the number of seconds that this member has been
online.

This value does not appear for the member that returns the
:method:`rs.status()` data.

.. data:: replSetGetStatus.members.optime

A document that contains information regarding the last operation
from the operation log that this member has applied.

.. data:: replSetGetStatus.members.optime.t

A 32-bit timestamp of the last operation applied to this member
of the replica set from the :term:`oplog`.

.. data:: replSetGetStatus.members.optime.i

An incremented field, which reflects the number of operations
in since the last time stamp. This value only increases if
there is more than one operation per second.

.. data:: replSetGetStatus.members.optimeDate

An :term:`ISODate` formatted date string that reflects the last
entry from the :term:`oplog` that this member applied. If this
differs significantly from
:data:`~replSetGetStatus.members.lastHeartbeat` this member is
either experiencing "replication lag" *or* there have not been any
new operations since the last update. Compare
``members.optimeDate`` between all of the members of the set.

.. data:: replSetGetStatus.members.lastHeartbeat

The ``lastHeartbeat`` value provides an :term:`ISODate` formatted
date of the last heartbeat received from this member. Compare this
value to the value of the :data:`~replSetGetStatus.date` field to
track latency between these members.

This value does not appear for the member that returns the
:method:`rs.status()` data.

.. data:: replSetGetStatus.members.pingMS

The ``pingMS`` represents the number of milliseconds (ms) that a
round-trip packet takes to travel between the remote member and
the local instance.

rs.status()
This value does not appear for the member that returns the
:method:`rs.status()` data.

.. slave-ok, admin-only
.. data:: replSetGetStatus.syncingTo

.. seealso:: ":doc:`/reference/replica-status`" and ":doc:`/core/replication`"
The ``syncingTo`` field is only present on the output of
:method:`rs.status()` on :term:`secondary` and recovering members,
and holds the hostname of the member from which this instance is
syncing.
2 changes: 1 addition & 1 deletion source/reference/method/db.printReplicationInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ db.printReplicationInfo()

Provides a formatted report of the status of a :term:`replica set`
from the perspective of the :term:`primary` set member. See the
":doc:`/reference/replica-status`" for more information regarding
:doc:`/reference/command/replSetGetStatus` for more information regarding
the contents of this output.

.. |method| replace:: :method:`db.printReplicationInfo()`
Expand Down
2 changes: 1 addition & 1 deletion source/reference/method/db.printSlaveReplicationInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ db.printSlaveReplicationInfo()

Provides a formatted report of the status of a :term:`replica set`
from the perspective of the :term:`secondary` set member. See the
":doc:`/reference/replica-status`" for more information regarding
:doc:`/reference/command/replSetGetStatus` for more information regarding
the contents of this output.

.. |method| replace:: :method:`db.printSlaveReplicationInfo()`
Expand Down
3 changes: 0 additions & 3 deletions source/reference/method/rs.status.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ rs.status()

This method provides a wrapper around the
:dbcommand:`replSetGetStatus` :term:`database command`.

.. seealso:: ":doc:`/reference/replica-status`" for documentation
of this output.
2 changes: 1 addition & 1 deletion source/reference/mongostat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ UNIX/Linux file system utility ``vmstat``, but provides data regarding
For more background on various other MongoDB status outputs see:

- :doc:`/reference/command/serverStatus`
- :doc:`/reference/replica-status`
- :doc:`/reference/command/replSetGetStatus`
- :doc:`/reference/command/dbStats`
- :doc:`/reference/command/collStats`

Expand Down
2 changes: 1 addition & 1 deletion source/reference/mongotop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ provides statistics on a per-collection level. By default,
see:

- :doc:`/reference/command/serverStatus`
- :doc:`/reference/replica-status`
- :doc:`/reference/command/replSetGetStatus`
- :doc:`/reference/command/dbStats`
- :doc:`/reference/command/collStats`

Expand Down
Loading