- Reference >
- Database Commands >
- Sharding Commands >
- balancerStop
balancerStop¶
On this page
Definition¶
-
balancerStop
¶ New in version 3.4.
Disables the balancer in a sharded cluster. If a balancing round is in progress, the operation waits for balancing to complete.
Starting in MongoDB 4.2, the command disables auto-splitting for the sharded cluster. To enable auto-splitting when the balancer is disabled, you can use
sh.enableAutoSplit()
.You can only issue the
balancerStop
against theadmin
database on amongos
instance.Tip
In the mongo Shell, this command can also be run through the
sh.stopBalancer
helper method.Helper methods are convenient for mongo users, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.
Syntax¶
You can only issue the balancerStop
against the
admin
database on a mongos
instance.
The command takes the following form:
Field | Type | Description |
---|---|---|
balancerStop |
any | Any value. |
maxTimeMS |
integer | Time limit for disabling the balancer. Defaults to 60000 milliseconds. Changed in version 3.4: If using the 3.4 |