@@ -656,6 +656,49 @@ Possible causes of replication lag include:
656
656
- The :ref:`replica-set-procedure-change-oplog-size` topic this document.
657
657
- The :doc:`/tutorial/change-oplog-size` tutorial.
658
658
659
+ .. _replica-set-troubleshooting-check-connection:
660
+
661
+ Test the Connection Between Each Member
662
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
663
+
664
+ There must be connectivity from every :term:`replica set` member to
665
+ every other member in order for replication to work. Problems with
666
+ network or firewall rules can prevent this connectivity and prevent
667
+ replication from working. To test the connection from every member to
668
+ every other member, in both directions, consider the following example:
669
+
670
+ .. example:: Given a replica set with three members running on three separate
671
+ hosts:
672
+
673
+ - ``m1.example.net``
674
+ - ``m2.example.net``
675
+ - ``m3.example.net``
676
+
677
+ 1. Test the connection from ``m1.example.net`` to the other hosts by running
678
+ the following operations from ``m1.example.net``:
679
+
680
+ .. code-block:: sh
681
+
682
+ mongo --host m2.example.net --port 27017"
683
+
684
+ mongo --host m3.example.net --port 27017"
685
+
686
+ #. Test the connection from ``m2.example.net`` to the other two
687
+ hosts by running similar appropriate operations from ``m2.example.net``.
688
+
689
+ This means you have now tested the connection between
690
+ ``m2.example.net`` and ``m1.example.net`` twice, but each time
691
+ from a different direction. This is important to verifying
692
+ connectivity. Network topologies and firewalls might allow a
693
+ connection in one direction but not the other. Therefore you must
694
+ make sure to verify that the connection works in both directions.
695
+
696
+ #. Test the connection from ``m3.example.net`` to the other two
697
+ hosts by running the operations from ``m3.example.net``.
698
+
699
+ If a connection in any direction fails, there's a networking or
700
+ firewall issue that needs to be diagnosed separately.
701
+
659
702
.. index:: pair: replica set; failover
660
703
.. _replica-set-failover-administration:
661
704
.. _failover:
0 commit comments