Docs Menu

Convert a Replica Set to a Sharded Cluster

On this page

  • Prerequisites
  • Procedure

You can convert a replica set to a sharded cluster.

To convert your replica set to a sharded cluster:

  • Your cluster must be an M10 or higher cluster.
  • You must have Project Cluster Manager or higher role.
1
  1. If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
  2. If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
  3. If the Database Deployments page is not already displayed, click Databases in the sidebar.
2
3
4
5
Note

After you convert a replica set to a sharded cluster, you can't convert it again to a replica set.

6

Sharding supports high throughput and large datasets, and you can increase the number of shards as data requirements grow. By default, Atlas creates two shards.

7

It may take some time for Atlas to deploy the changes. Please wait until Atlas has converted your cluster before proceeding to the next step.

8

If you don't restart the application clients, your data might be inconsistent after Atlas begins distributing data across shards.

  • If you are using a DNS Seed List connection string, your application automatically connects to the mongos for your sharded cluster.
  • If you are using a standard connection string, you must update your connection string to reflect your new cluster topology.

To learn more, see Connect to a Database Deployment.

9

To shard the collection whose data you want to distribute, see sh.shardCollection() for more information.

10

If you want to make further changes to the sharded cluster, see Modify a Cluster for more information on the cluster-wide settings that you can modify.

Give Feedback
© 2021 MongoDB, Inc.

About

  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.