Docs Menu

Docs HomeMongoDB Manual

balancerStop

On this page

  • Definition
  • Syntax
  • Example
balancerStop

Disables the balancer in a sharded cluster. If a balancing round is in progress, the operation waits for balancing to complete.

You can only issue the balancerStop against the admin database on a mongos instance.

Starting in MongoDB 6.1, automatic chunk splitting is not performed. This is because of balancing policy improvements. Auto-splitting commands still exist, but do not perform an operation. For details, see Balancing Policy Changes.

In MongoDB versions earlier than 6.1, the command disables auto-splitting for the sharded cluster. To enable auto-splitting when the balancer is disabled, you can use sh.enableAutoSplit()

The command has the following syntax:

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

Time limit for disabling the balancer.

Defaults to 60000 milliseconds.

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

db.adminCommand( { balancerStop: 1 } )

Tip

See also:

←  balancerStatuscheckShardingIndex →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.