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版)
240
14
熟悉单机服务器和副本集。此外,与副本集一样,配置和部署分片集群的推荐方式是通
MongoDB
Ops Manager
MongoDB Atlas
。如果需要保留对计算基础设施的控制,建议
使用
Ops
Manager
。如果可以将基础设施管理留给
MongoDB
(可以选择在
Amazon AWS
Microsoft Azure
Google Compute Cloud
中运行)
,则推荐使用
MongoDB Atlas
14.2
 理解集群组件
MongoDB
的分片机制允许你创建一个由许多机器(分片)组成的集群,并将集合中的数
据分散在集群中,在每个分片上放置数据的一个子集。这允许应用程序超出单机服务器或
副本集的资源限制。
许多人对复制和分片之间的区别感到困惑。记住,复制在多台服务器上创建
了数据的精确副本,因此每台服务器都是其他服务器的镜像。相反,每个分
片包含了不同的数据子集。
分片的目标之一是使由两个、
3
个、
10
个甚至数百个分片组成的集群对应用程序来说就像
是一台单机服务器。为了对应用程序隐藏这些细节,需要在分片前面运行一个或多个称为
mongos
的路由进程
mongos
维护着一个“目录”,指明了哪个分片包含哪些数据。如图
14-1
所示
,应用程序可以正常连接到此路由服务器并发出请求。路由服务器知道哪些数据
在哪个分片上,可以将请求转发到适当的分片。如果有对请求的响应,路由服务器会收集
它们,并在必要时进行合并,然后再发送回应用程序。对应用程序来说,它只知道自己连
接到了一个单独的
mongod
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