@@ -339,6 +339,30 @@ the event of a network partition.
339
339
.. seealso:: :data:`~local.system.replset.settings.members[n].votes` and :ref:`Replica Set
340
340
Reconfiguration <replica-set-reconfiguration-usage>`.
341
341
342
+ .. _replica-set-chained-replication:
343
+
344
+ Chained Replication
345
+ ~~~~~~~~~~~~~~~~~~~
346
+
347
+ Chained replication occurs when a :term:`secondary` member replicates
348
+ from another secondary member instead of from the :term:`primary`. This
349
+ might be the case, for example, if a secondary selects its replication
350
+ target based on ping time and if the closest member is another secondary.
351
+
352
+ Chained replication has the benefit of providing load balancing in cases
353
+ where the primary is heavily loaded. But, depending on the network
354
+ topology, replication chaining can also result in increased replication
355
+ lag.
356
+
357
+ .. versionadded:: 2.2.2
358
+
359
+ You can use the
360
+ :data:`chainingAllowed <local.system.replset.settings.chainingAllowed>`
361
+ setting in
362
+ :doc:`/reference/replica-configuration` to disable chained replication
363
+ for situations where replication lag is an issue. For details, see
364
+ :ref:`replica-set-config-chained-replication`.
365
+
342
366
Procedures
343
367
----------
344
368
@@ -586,6 +610,54 @@ after the initial sync operation.
586
610
587
611
.. include:: /includes/fact-replica-set-sync-from-is-temporary.rst
588
612
613
+ .. _replica-set-config-chained-replication:
614
+
615
+ Enable or Disable Chained Replication
616
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
617
+
618
+ .. versionadded:: 2.2.2
619
+
620
+ :ref:`replica-set-chained-replication` is enabled by default. This
621
+ procedure describes how to disable it and how to re-enable it.
622
+
623
+ To disable chained replication, set the
624
+ :data:`local.system.replset.settings.chainingAllowed`
625
+ field in :doc:`/reference/replica-configuration` to ``false``.
626
+
627
+ You can use the following sequence of commands to set ``chainingAllowed`` to
628
+ ``false``:
629
+
630
+ 1. Copy the configuration settings into the ``cfg`` object:
631
+
632
+ .. code-block:: javascript
633
+
634
+ cfg = rs.conf()
635
+
636
+ #. Take note of whether the current configuration settings contain the
637
+ ``settings`` sub-document. If they do, skip this step.
638
+
639
+ .. warning:: To avoid data loss, skip this step if the configuration
640
+ settings contain the ``settings`` sub-document.
641
+
642
+ If the current configuration settings **do not** contain the
643
+ ``settings`` sub-document, create the sub-document by issuing the
644
+ following command:
645
+
646
+ .. code-block:: javascript
647
+
648
+ cfg.settings = { }
649
+
650
+ #. Issue the following sequence of commands to set ``chainingAllowed``
651
+ to ``false``:
652
+
653
+ .. code-block:: javascript
654
+
655
+ cfg.settings.chainingAllowed = false
656
+ rs.reconfig(cfg)
657
+
658
+ To re-enable chained replication, use :dbcommand:`replSetSyncFrom` to
659
+ specify that each secondary replicates from the primary.
660
+
589
661
.. _replica-set-procedure-change-oplog-size:
590
662
591
663
Changing Oplog Size
0 commit comments