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版)
创建副本集
191
一旦启动它们,就应该有
3
个单独的
mongod
进程在运行。
通常来说,本章余下内容中介绍的原理适用于生产部署中使用的副本集,其
中每个
mongod
都有一个专用主机。不过,第
19
章会详细介绍与保护副本集
有关的一些其他细节问题,本章先提前在此处简要介绍一下这些内容。
10.3
 网络注意事项
副本集中的每个成员都必须能够连接到其他成员(包括自身)。如果收到有关成员无法访
问到其他正在运行成员的错误,则可能需要更改网络配置以允许它们之间的连接。
已启动的进程可以轻松地在单独的服务器上运行。但是,在
MongoDB
3.6
中,
mongod
仅在
默认情况下绑定到
localhost
127.0.0.1
。为了使副本集中每个成员都可以与其他成员通信,
还必须绑定到其他成员可以访问到的
IP
地址
。如果在
IP
地址为
192.51.100.1
的网络接口的
服务器上运行
mongod
实例
,并且希望将其作为副本集的成员运行,同时每个成员都在不同
的服务器上,则可以指定命令行参数
--bind_ip
或在此实例的配置文件中使用
bind_ip
$ mongod --bind_ip localhost,192.51.100.1 --replSet mdbDefGuide \
--dbpath ~/data/rs1 --port 27017 --smallfiles --oplogSize 200
在这种情况下,无论是在
Linux
macOS
还是
Windows
系统中运行,都将进行类似的修改
以启动其他的
mongod
10.4 ...
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