transitionFromDedicatedConfigServer
Definition
New in version 8.0.
Starting in MongoDB 8.0, you can:
Configure a config server to store your application data in addition to the usual
sharded cluster metadata. A config server that stores application data is called a config shard.Transition a config server between being a config shard and a dedicated config server.
A cluster requires a config server, but it can be a config shard instead of a dedicated config server. Using a config shard reduces the number of nodes required and can simplify your deployment.
If your application has demanding availability and resiliency requirements, consider deploying a dedicated config server. A dedicated config server provides isolation, dedicated resources, and consistent performance for critical cluster operations.
The transitionFromDedicatedConfigServer
command configures a dedicated config server to run as a config shard.
Before you run transitionFromDedicatedConfigServer
, connect to mongos
and use the admin database.
The sharded cluster must have featureCompatibilityVersion set to at least 8.0
.
Syntax
Command syntax:
db.adminCommand( { transitionFromDedicatedConfigServer: 1 } )
Behavior
The transitionFromDedicatedConfigServer
command adds the config server as a shard in the cluster. Internally, transitionFromDedicatedConfigServer
runs the addShard
command.
To confirm that a sharded cluster uses a config shard, run the listShards
command against the admin
database while connected to a mongos
and inspect the output for a document where _id
is set to "config"
. If the listShards
output does not contain a document where _id
is set to "config"
, the cluster does not use a config shard.
For details, see Confirm use of Config Shard.
If you must downgrade the feature compatibility version below 8.0, first run the transitionToDedicatedConfigServer
command. For downgrade details, see Downgrade Feature Compatibility Version.
Access Control
If access control is enabled, the transitionFromDedicatedConfigServer
command requires the transitionFromDedicatedConfigServer
authorization action for the cluster:
{ resource: { cluster : true }, actions: [ "transitionFromDedicatedConfigServer" ] }
The clusterManager
role has transitionFromDedicatedConfigServer
authorization action and can be assigned to a user.
The following example assigns the clusterManager
role to a user named testUser
:
db.grantRolesToUser( "testUser", [ "clusterManager" ] )
Example
The following example configures a dedicated config server to run as a config shard:
db.adminCommand( { transitionFromDedicatedConfigServer: 1 } )