Convert a Replica Set to a Sharded Cluster¶
To convert your replica set to a sharded cluster:
- Your cluster must be an
M10or higher cluster.
- You must have
Project Cluster Manageror higher role.
Navigate to the Database Deployments page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
- If the Database Deployments page is not already displayed, click Databases in the sidebar.
Click the cluster name to view cluster details.¶
Click Configuration in the Overview tab to view the page where you can edit your cluster settings.¶
Expand Additional Settings to modify your cluster configuration.¶
Enable sharding in the Shard your cluster section by setting the toggle to On.¶
After you convert a replica set to a sharded cluster, you can't convert it again to a replica set.
Select the number of shards from the dropdown.¶
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.
Click Review Changes to review the changes to billing and when satisfied, click Apply Changes.¶
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.
Restart all application clients and reconnect to the sharded cluster.¶
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
mongosfor 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.