Navigation

Convert a Replica Set to a Sharded Cluster

On this page

Overview

Cloud Manager provides the ability to convert a replica set to a sharded cluster.

Procedure

1

Click Deployment, then the Processes tab, then the Topology view.

2

Click the ellipsis icon then select Convert to Sharded Cluster.

3

Configure the sharded cluster.

Field Action
Cluster Name Specify the name of your new cluster.
# of Mongos

Specify the number of MongoDB Shard routing services (mongos) you want in the cluster.

Note

See /core/sharded-cluster-components for how to configure a sufficient number of mongos for production and development configurations.

mongos Distribution Specify where you want the mongos processes to be installed.
Mongos Eligible Port Range Specify the range of ports within which the mongos processes run.
# of Config Servers

Specify the number of members in your configuration server replica set.

Note

The configuration server replica set should have at least three members for a production instance.

Config Distribution Specify where you want the configuration server members to be installed.
Config Eligible Port Range Specify the range of ports within which the configuration server’s mongod processes run.
Config Server Replica Set Name Specify the name of your configuration server replica set.
4

Click Next.

5

Drag and drop the mongos processes onto the available servers.

The mongos processes can be placed on any of the servers provisioned for your deployment.

6

Click Review & Deploy to review your changes.

7

Review and approve your changes.

Cloud Manager displays your proposed changes.

  1. If you are satisfied, click Confirm & Deploy.
  2. Otherwise, click Cancel and you can make additional changes.
8

Modify your application to connect to the mongos processes instead of the replica set

After you convert a replica set to a sharded cluster, you can enable sharding for a database and shard collections. See Shard a Collection for instructions on how to shard collections.

If you need to add additional shards to support greater capacity, click on the wrench menu for the sharded cluster to create additional shards.