March 2019
Intermediate to advanced
394 pages
11h 4m
English
Replication in MongoDB usually happens from the primary to the secondaries. In some cases, we may want to replicate from another secondary, instead of the primary. Chained replication helps to alleviate the primary from read load, but at the same time, it increases the average replication lag for the secondary that chooses to replicate from a secondary. This makes sense, as replication has to go from the primary to the secondary (1), and then from this server to another secondary (2).
Chained replication can be enabled (and disabled, respectively) with the following cfg command:
> cfg.settings.chainingAllowed = true
In cases where printjson(cfg) doesn't reveal a settings sub-document, we need to create an empty one first: ...
Read now
Unlock full access