balancerStart

Definition

  • balancerStart

New in version 3.4.

Starts the balancer thread. The command does not wait for abalancing round to start.

Starting in MongoDB 4.2, the command enables auto-splitting for thesharded cluster. To disable auto-splitting when the balancer isenabled, you can use sh.disableAutoSplit().

Syntax

You can only issue thebalancerStart against the admin database on amongos instance.

The command takes the following form:

  1. db.adminCommand( { balancerStart: 1, maxTimeMS: <number> } )
FieldTypeDescription
balancerStartanyAny value.
maxTimeMSintegerOptional. Time limit for enabling the balancer.Defaults to 60000 milliseconds.Changed in version 3.4: If using the 3.4 mongo shell with earlier versionsharded clusters, the parameter specifies the amount of time towait for the balancing round to start.

Example

To start the balancer thread, connect to a mongos instanceand issue the following command:

  1. db.adminCommand( { balancerStart: 1 } )

See also