@@ -581,7 +581,7 @@ of the information displayed by :method:`rs.status()`, see
581
581
:doc:`/reference/replica-status`.
582
582
583
583
.. note:: The :method:`rs.status()` method is a wrapper that runs the
584
- :doc:`/reference/command/ replSetGetStatus` database command.
584
+ :dbcommand:` replSetGetStatus` database command.
585
585
586
586
.. _replica-set-replication-lag:
587
587
@@ -596,14 +596,13 @@ replication lag makes "lagged" members ineligible to quickly become
596
596
primary and increases the possibility that distributed
597
597
read operations will be inconsistent.
598
598
599
- To check the current duration of replication lag, do one of the following :
599
+ To check the current length of replication lag:
600
600
601
- - Run the :doc:`db.printSlaveReplicationInfo()
602
- </reference/method/db.printSlaveReplicationInfo>` method in a
603
- :program:`mongo` shell connected to the replica set's primary.
601
+ - In a :program:`mongo` shell connected to the primary, call the
602
+ :method:`db.printSlaveReplicationInfo()` method.
604
603
605
- The output displays each member's ``syncedTo`` value, which is the
606
- last time the member read from the oplog, as shown in the following
604
+ The outputted document displays the ``syncedTo`` value for each member,
605
+ which shows you when each member last read from the oplog, as shown in the following
607
606
example:
608
607
609
608
.. code-block:: javascript
@@ -616,21 +615,16 @@ To check the current duration of replication lag, do one of the following:
616
615
= 7475 secs ago (2.08hrs)
617
616
618
617
.. note:: The :method:`rs.status()` method is a wrapper that runs the
619
- :doc:`/reference/command/ replSetGetStatus` database command.
618
+ :dbcommand:` replSetGetStatus` database command.
620
619
621
- - Run the :method:`rs.status()` method in a :program:`mongo` shell
622
- connected to the replica set's primary. The output displays each
623
- member's `optimeDate` value, which is the last time the member read
624
- from the oplog.
625
-
626
- - Monitor how fast replication occurs by watching the oplog time in the
620
+ - Monitor the rate of replication by watching the oplog time in the
627
621
"replica" graph in the `MongoDB Monitoring Service`_. For more
628
622
information see the `documentation for MMS`_.
629
623
630
624
.. _`MongoDB Monitoring Service`: http://mms.10gen.com/
631
625
.. _`documentation for MMS`: http://mms.10gen.com/help/
632
626
633
- If replication lag is too large, check the following :
627
+ Possible causes of replication lag include :
634
628
635
629
- **Network Latency**
636
630
@@ -699,31 +693,36 @@ staying up-to-date or becoming stale.
699
693
700
694
To check the size of the oplog for a given :term:`replica set` member,
701
695
connect to the member in a :program:`mongo` shell and run the
702
- :doc:`db.printReplicationInfo()
703
- </reference/method/db.printReplicationInfo>` method.
696
+ :method:`db.printReplicationInfo()` method.
704
697
705
- The method displays the size of the oplog and the date ranges of the
698
+ The output displays the size of the oplog and the date ranges of the
706
699
operations contained in the oplog. In the following example, the oplog
707
- is about 10MB and is able to fit only about 20 minutes (1200 seconds) of
700
+ is about 10MB and is able to fit about 26 hours (94400 seconds) of
708
701
operations:
709
702
710
703
.. code-block:: javascript
711
704
712
705
configured oplog size: 10.10546875MB
713
- log length start to end: 1200secs (0.33hrs )
706
+ log length start to end: 94400 (26.22hrs )
714
707
oplog first event time: Mon Mar 19 2012 13:50:38 GMT-0400 (EDT)
715
- oplog last event time: Tue Oct 02 2012 16:31:38 GMT-0400 (EDT)
716
- now: Tue Oct 02 2012 17:04:20 GMT-0400 (EDT)
708
+ oplog last event time: Wed Oct 03 2012 14:59:10 GMT-0400 (EDT)
709
+ now: Wed Oct 03 2012 15:00:21 GMT-0400 (EDT)
717
710
711
+ The oplog should be long enough to hold all transactions for the longest
712
+ downtime you expect on a secondary. In many cases, an oplog should fit
713
+ at minimum 24 hours of operations. A size of 72 hours is often
714
+ preferred. And it is not uncommon for an oplog to fit a week's worth of
715
+ operations.
718
716
719
- The above example is likely a case where you would want to increase the
720
- size of the oplog. For more information on how oplog size affects
721
- operations, see:
717
+ For more information on how oplog size affects operations, see:
722
718
723
719
- The :ref:`replica-set-oplog-sizing` topic in the :doc:`/core/replication` document.
724
720
- The :ref:`replica-set-delayed-members` topic in this document.
725
721
- The :ref:`replica-set-replication-lag` topic in this document.
726
722
723
+ .. note:: You normally want the oplog to be the same size on all
724
+ members. If you resize the oplog, resize it on all members.
725
+
727
726
To change oplog size, see :ref:`replica-set-procedure-change-oplog-size`
728
727
in this document or see the :doc:`/tutorial/change-oplog-size` tutorial.
729
728
@@ -745,19 +744,30 @@ every other member, in both directions, consider the following example:
745
744
- ``m2.example.net``
746
745
- ``m3.example.net``
747
746
748
- You can test the connection from ``m1.example.net`` to the other hosts by running
749
- the following operations from ``m1.example.net``:
747
+ 1. Test the connection from ``m1.example.net`` to the other hosts by running
748
+ the following operations from ``m1.example.net``:
749
+
750
+ .. code-block:: sh
751
+
752
+ mongo --host m2.example.net --port 27017"
750
753
751
- .. code-block:: sh
754
+ mongo --host m3.example.net --port 27017"
752
755
753
- mongo --host m2.example.net --port 27017"
756
+ #. Test the connection from ``m2.example.net`` to the other two
757
+ hosts by running similar appropriate operations from ``m2.example.net``.
754
758
755
- mongo --host m3.example.net --port 27017"
759
+ This means you have now tested the connection between
760
+ ``m2.example.net`` and ``m1.example.net`` twice, but each time
761
+ from a different direction. This is important to verifying
762
+ connectivity. Network topologies and firewalls might allow a
763
+ connection in one direction but not the other. Therefore you must
764
+ make sure to verify that the connection works in both directions.
756
765
757
- Repeat the process on hosts ``m2.example.net`` and ``m3.example.net``.
766
+ #. Test the connection from ``m3.example.net`` to the other two
767
+ hosts by running the operations from ``m3.example.net``.
758
768
759
- If any of the connections fails, there's a networking or firewall
760
- issue that needs to be diagnosed separately
769
+ If a connection in any direction fails, there's a networking or
770
+ firewall issue that needs to be diagnosed separately.
761
771
762
772
.. index:: pair: replica set; failover
763
773
.. _replica-set-failover-administration:
0 commit comments