Cloud Manager provides the ability to convert a replica set to a sharded cluster.
在MongoDB Cloud Manager中,转到项目的 Processes 页面。
如果尚未显示,请从导航栏上的 Organizations 菜单中选择包含所需项目的组织。
如果尚未显示,请从导航栏的Projects菜单中选择所需的项目。
在侧边栏中,单击 Database 标题下的 Processes。
The Processes page displays.
转换所需的副本集。
From the menu on the desired replica set, click Convert to Sharded Cluster.
提供新分片集群的详细信息。
在Provide details for your new sharded cluster模式中配置以下设置:
Name your sharded cluster components:
字段操作Cluster Name
输入新集群的名称。
CSRS Name
输入CSRS的名称。
注意
单击Convert后无法更改这些值。
Set the following values for each
mongodprocess in your Config Servers. All fields are required.注意
您必须部署至少一台配置服务器。
字段操作Host Name
从菜单中选择现有主机名,或在列表上方的搜索框中键入主机名以查找主机。
如果需要添加新主机:
单击 New Server(管理员)链接。
单击 Next(连接)。
按照说明在该新主机上安装新的自动化。
单击 Verify Agent(连接)。
Port
输入IANA端口号。
Data Directory
Log File
注意
添加或删除配置服务器
要添加新的配置服务器,请单击Add a Config Server 。
要删除配置服务器,请单击位于要删除的配置服务器右侧。
修改应用程序以连接到mongos 进程而不是副本集。
From the Cloud Manager UI, click the icon, then click Connect to this instance. The Connect to your Deployment dialog provides the hostname and port of a mongos in the cluster.
有关连接到 Cloud Manager 部署的完整文档,请参阅连接到 MongoDB 进程
更改任何集群范围的设置。
If you want to make any further changes to the sharded cluster, see the Sharded Cluster tab on the Edit a Deployment's Configuration page.
将副本集转换为分片集群后,您可以为数据库和collection启用分片。
To learn how to shard collections, see Shard a Collection.
如果您需要添加其他分片以支持更大的容量,请单击分片集群的扳手菜单以创建其他分片。
注意
转换后对备份的影响
转换后的分片(原始副本集)具有:
backupEnabled
保留以前的快照
只有能力将快照恢复到此分片
After converting, you should enable Backup for the entire sharded cluster. On databases running MongoDB FCV 4.0 or earlier, activating Backup causes Cloud Manager to start an initial sync on the config servers and the converted shard. Restores to the entire sharded cluster should use snapshots taken after conversion only.