So i've been studying MongoDB for some time now and i am starting to learn not only how to do things, but how these things are actually done.
According to the Official Documentation on data Replication all changes to the Primary node are written on the Operation log, ie oplog, and the secondary servers copy those changes. What i could not find in the official documentation, or any other source for that matter, who is responsible for communicating when the Primary oplog is changed.
Does the Primary Server let Secondary Servers know that there were new operations on the Oplog and they go fetch it, or the Secondary Servers check the oplog from time to time? Or is that a configuration when creating a replica set?
答案 0 :(得分:1)
辅助成员在初始同步后不断复制数据 并从他们的
sync from source
复制oplog并应用这些 异步过程中的操作。
在大多数情况下,辅助节点从主节点同步。
如果需要,辅助人员可以自动更改
sync from source
基于ping时间和其他成员状态的变化 复制。Secondries避免与延迟成员或隐藏成员同步。
Secondry继续ping主服务器以获取oplog文件,如果它不能超过10秒,那么它会要求选举。
的官方文件中提取此信息