MongoDB: The Definitive Guide by Kristina Chodorow

MongoDB: The Definitive Guide by Kristina Chodorow

Author:Kristina Chodorow
Language: eng
Format: epub, azw3, pdf
Tags: COMPUTERS / Data Modeling & Design
Publisher: O’Reilly Media
Published: 2013-05-08T16:00:00+00:00


Figure 12-2. As replication chains get longer, it takes longer for all members to get a copy of the data

This is highly unlikely, but not impossible. It is, however, probably undesirable: each secondary in the chain will have to be a bit further behind than the secondary “in front” of it. You can fix this by modifying the replication source for a member using the replSetSyncFrom command (or the rs.syncFrom() helper).

Connect to the secondary whose replication source you want to change and run this command, passing it the server you’d prefer this member to sync from:

> secondary.adminCommand({"replSetSyncFrom" : "server0:27017"})

It may take a few seconds to switch sync sources, but if you run rs.status() on that member again, you should see that the "syncingTo" field now says "server0:27017".

At this point, server4 will continue replicating from server0 until server0 becomes unavailable or, if it happened to be a secondary, falls significantly behind the other members.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.