翻译或纠错本页面

balancerStart

On this page

Definition

balancerStart

3.4 新版功能.

Starts the balancer thread. The command does not wait for a balancing round to start. You can only issue the balancerStart against the admin database.

The command takes the following form:

db.adminCommand( { balancerStart: 1, maxTimeMS: <number> } )
Field Type Description
balancerStart any Any value.
maxTimeMS integer

Optional. Time limit for enabling the balancer.

Defaults to 60000 milliseconds.

在 3.4 版更改: If using the 3.4 mongo shell with earlier version sharded clusters, the parameter specifies the amount of time to wait for the balancing round to start.

Example

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

db.adminCommand( { balancerStart: 1 } )
←   addShard balancerStatus  →