Skip to Content
MongoDB权威指南(第3版)
book

MongoDB权威指南(第3版)

by Shannon Bradshaw, Eoin Brazil, Kristina Chodorow
November 2021
Intermediate to advanced
410 pages
12h 1m
Chinese
Posts & Telecom Press
Content preview from MongoDB权威指南(第3版)
210
11
还有一点,克隆可能会破坏同步源的工作集。在许多情况下,某些数据的子集经常会被访
问,因而这部分数据总是存在于内存中(因为操作系统经常对其进行访问)。执行初始化同
步会强制此成员将其所有数据分页加载到内存中,从而“驱逐”那些经常使用的数据。当那
些通常由
RAM
中的数据进行处理的请求突然被迫转到磁盘时
,可能此成员的速度会显著降
低。不过,对于那些小型数据集和性能较好的服务器,初始化同步是一个简单易用的选择。
进行初始同步时一个最常见的问题就是时间过长。在这种情况下,新成员可能会从同步源
oplog
末尾
“脱离”:由于同步源的
oplog
已经覆盖了成员继续复制所需的数据,因此新
成员会远远落后于同步源并且无法再跟上。
除了在不太忙的时候尝试初始化同步或从备份进行恢复之外,没有其他方法可以解决这个
问题。如果成员已经脱离了同步源的
oplog
,那么初始化同步将无法进行
。这部分内容会
1
1.1.3
节进行介绍。
11.1.2
 复制
MongoDB
执行的第二种同步是复制。从节点成员在初始化同步之后会持续复制数据。它
们从同步源复制
oplog
,并在一个异步进程中应用这些操作
。从节点可以根据需要自动更
改同步源,以应对
ping
时间及其他成员复制状态的变化
。有一些规则可以控制给定节点从
哪些成员进行同步。例如,拥有投票权的副本集成员不能从没有投票权的成员那里同步数
据,从节点不能从延迟成员和隐藏成员那里同步数据。后续章节会讨论副本集成员的选举
以及不同的成员种类。
11.1.3
 处理过时数据
如果某个从节点远远落后于同步源当前的操作,那么这个从节点就是 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Spark快速大数据分析(第2版)

Spark快速大数据分析(第2版)

Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee
Kafka权威指南(第2版)

Kafka权威指南(第2版)

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9787115576538