Overview
您可以直接在 Cloud Manager 控制台中添加、删除和重新配置副本集中的节点。
注意
Cloud Manager restarts a node in a replica set or sharded cluster when you change configuraton file options for the MongoDB process running on the node. The following options trigger a restart only for the specified changes:
security.clusterAuthMode: Changing the value fromkeyfiletosendKeyFiletriggers a restart. All other changes to this option do not.net.tls.mode: Changing the value fromdisabledtoallowTLStriggers a restart. All other changes to this option do not.
A restarted node triggers an election if the node was the primary. In addition, modifying the member settings of the current primary may trigger an election.
步骤
添加副本集成员
您必须有一台现有服务器来部署新的副本集成员。 要将成员添加到现有副本集,并增加副本集的大小:
在MongoDB Cloud Manager中,转到项目的 Processes 页面。
如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含所需项目的组织。
如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。
在侧边栏中,单击 Database 标题下的 Processes。
The Processes page displays.
在 Hostname 中,选择要添加为副本集新成员的托管。
如果主机未出现在Hostname列表中,请使用以下步骤添加主机:
在 Hostname 中,选择 New Server。
如果尚未将主机添加到项目中,则不会显示Hostname列表。 单击Install Agent 。
在Add New Server对话框中,选择您的操作系统并单击Next 。
按照说明在新主机上安装MongoDB 助手。
注意
When adding a new member to a replica set, set Build Indexes to True if you want the member's mongod to build indexes. You cannot change this value after the Automation adds the new member to the replica set. To learn more, see members[n].buildIndexes.
警告
If your replica set uses TLS, you must create and install the necessary TLS certificates on the new replica set member host first. Then, set the TLS settings for the mongod or mongos process for the new replica set member on that host. Automation does not create and install the certificates and configure these settings automatically. If you do not configure TLS on the new member, you cannot add it to the existing TLS-enabled replica set. To learn how to enable TLS on the new replica set member, see Enable TLS for a Deployment.
在Replica Set Configuration部分中,为新成员填写以下字段:
Auth Schema Version
选择用于存储部署的用户数据的模式。 有关更多信息,请参阅升级到 SCRAM 。
Feature Compatibility (可选)
Select the
feature compatibility set.Version
为您的副本集选择 MongoDB 版本。
Data Directory
指定
mongod进程将存储数据文件的目录的完整路径。重要提示:确保新成员的数据目录不包含数据。新成员将从现有成员复制数据。
If the new member is in a recovering state, it must exit and become a secondary before MongoDB can copy all data as part of the replication process. This process doesn't require administrator intervention.
Log File
指定新主机上
mongod进程的日志文件的位置和名称。
重要
To avoid disrupting majority writes, new members are now added to replica sets as priority=0, votes=0 until they reach secondary state, after which Cloud Manager automatically updates the configuration to match the priority and votes value specified in the deployment.
编辑副本集成员
To reconfigure a member as an arbiter, see Replace a Member with an Arbiter
在MongoDB Cloud Manager中,转到项目的 Processes 页面。
如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含所需项目的组织。
如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。
在侧边栏中,单击 Database 标题下的 Processes。
The Processes page displays.
在Member Configuration 中,修改要编辑的副本集的设置。
您可以修改以下设置:
Votes | 指定副本集节点是否在选举中投票。 值为 |
Priority | 指定副本集节点在选举期间的优先级。 无投票权成员的优先级必须为 |
Delay | 指定该成员是否为延迟副本集成员。 |
Build Indexes | 指定副本集节点是否构建索引。 |
Tags | 输入 JSON,定义要添加到副本集成员的标签集。 |
注意
After deploying the replica set, you can't modify a replica set member's hostname or port.
用仲裁节点替换节点
您不能直接将节点重新配置为仲裁节点。 相反,您必须将一个新成员作为仲裁节点添加到副本集。 然后,您必须关闭现有的从节点。
删除副本集成员
When you remove a member from a replica set, Cloud Manager converts the member's mongod to a standalone process and shuts it down.
删除节点时,必须在原始投票节点数量的基础上,保持大多数有投票权的节点处于活跃状态。 如果没有多数,副本集主节点将降级,副本集将变为只读。 有关投票的更多信息,请参阅 MongoDB 手册中的副本集选举和副本集高可用性。
删除成员可能会影响副本集确认写入的能力,具体取决于您使用的写关注级别。 有关更多信息,请参阅 MongoDB 手册中的写关注。
要删除成员:
在MongoDB Cloud Manager中,转到项目的 Processes 页面。
如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含所需项目的组织。
如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。
在侧边栏中,单击 Database 标题下的 Processes。
The Processes page displays.
编辑集群配置
要编辑集群配置,请执行以下操作:
在MongoDB Cloud Manager中,转到项目的 Processes 页面。
如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含所需项目的组织。
如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。
在侧边栏中,单击 Database 标题下的 Processes。
The Processes page displays.
配置副本集。
在 Replica Set Configuration 部分中,填写以下字段。
Auth Schema Version | 选择用于存储部署的用户数据的架构。 |
Feature Compatibility (可选) | Select the |
Version | 为您的副本集选择 MongoDB 版本。 |
Log File | Specify the location and name of the log file for the |
编辑复制设置
要编辑复制设置:
更多信息
有关副本集配置选项的更多信息,请参阅 MongoDB 手册中的副本集配置。