Docs Menu
Docs Home
/ /

startTransitionToDedicatedConfigServer (database command)

startTransitionToDedicatedConfigServer

Starts the transition from an embedded config server to a dedicated config server.

When the command runs, it tells the balancer that you want to start the transition to a dedicated config server. Asynchronously, the balancer then begins moving chunks from the shard to other shards in the cluster. Once the balancer has finished this process and you have manually migrated any unsharded collections to a different shard, you can safely remove it from the cluster because it no longer contains data. See the moveCollection command for more information.

The command returns an error if the transition fails, otherwise it returns ok.

New in version 8.3.

This command is available in deployments hosted in the following environments:

  • MongoDB Enterprise: The subscription-based, self-managed version of MongoDB

  • MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB

Note

This command is not supported in MongoDB Atlas. See Modify your Atlas Sharded Cluster to add or remove shards from your Atlas cluster.

The command has the following syntax:

db.adminCommand( {
startTransitionToDedicatedConfigServer: 1
} )

If you have authorization enabled, you must have the clusterManager role or any role that includes the removeShard action.

You cannot back up the cluster while starting the transition.

Each database in a sharded cluster has a primary shard. If the shard you want to drain is also the primary of one of the cluster's databases, then you must manually move the databases to a new shard after migrating all data from the shard. See the movePrimary command and the Remove Shards from a Sharded Cluster for more information.

Unsharded collections are stored on individual shards. If one of these collections is on the shard you want to remove, you must first migrate the collection to a different shard.

To migrate an unsharded collection, see the moveCollection command.

When you transition to a dedicated config server and the cluster has an uneven chunk distribution, the balancer first removes the chunks from the draining shard and then balances the remaining uneven chunk distribution.

Tip

mongos converts the write concern of the startTransitionToDedicatedConfigServer command to "majority".

Draining the embedded config server may cause an open change stream cursor to close, and the closed change stream cursor may not be fully resumable.

If you run startTransitionToDedicatedConfigServer while your cluster is executing a DDL operation (operation that modifies a collection such as reshardCollection), the transition only executes after the concurrent DDL operation finishes.

To start the transition, use the db.adminCommand() method:

db.adminCommand( {
startTransitionToDedicatedConfigServer: 1
} )

Back

startShardDraining

On this page