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版)
360
23
23.2
 对服务器进行备份
有多种方法可以创建备份。但无论采用哪种方法,备份操作都会对系统造成压力:备份通
常需要将所有数据读入内存中。因此,备份通常应该在副本集从节点而不是主节点上进
行。如果是单机服务器,则应该在空闲时间进行备份。
除非另有说明,本节介绍的技术适用于任何
mongod
,无论是单机服务器还是副本集成员。
23.2.1
 文件系统快照
文件系统快照使用系统级别的工具创建保存
MongoDB
数据文件的设备的副本。这种方式
的完成过程耗时非常短,并且很可靠,但需要在
MongoDB
之外进行额外的系统配置。
MongoDB 3.2
中增加了在使用
WiredT
iger
存储引擎时对
MongoDB
实例进行磁盘卷级别备
份的支持,即使实例中的数据文件和日志文件位于不同的卷上。然而,为了备份的一致
性,必须对数据库进行锁定,并且在备份过程中挂起对数据库的所有写操作。
MongoDB 3.2
之前,使用
W
iredTiger
创建
MongoDB
实例的卷级别备份需要数据文件和
日志文件在同一个卷上。
快照的工作原理是在实时数据和特殊的快照卷之间创建指针。这些指针在理论上相当于
“硬链接”。由于工作数据与快照不一致,快照进程会使用写时复制策略,因此快照只保存
那些修改过的数据。
创建快照后,可以将快照映像挂载到文件系统中,并从快照中复制数据。产生的备份包含
了所有数据的完整副本。
当进行快照的时候,数据库必须是有效的。这意味着数据库接受的所有写操作都需要完全
写入磁盘:写入日志或数据文件。如果备份发生时有些写操作没有在磁盘上 ...
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