Docs Menu

Docs HomeMongoDB Manual

sh.stopBalancer()

On this page

  • Definition
  • Behavior
sh.stopBalancer(timeout, interval)

Changed in version 4.2.

Disables the balancer in a sharded cluster. Starting in MongoDB 4.2, sh.stopBalancer() also disables auto-splitting for the sharded cluster.

The method can take the following options:

Parameter
Type
Description
timeout
integer

Time limit for disabling the balancer.

Defaults to 60000 milliseconds.

interval
integer
The interval (in milliseconds) at which to check if the balancing round has stopped.

You can only run sh.stopBalancer() on a mongos instance. sh.stopBalancer() errors if run on mongod instance.

The mongosh shell method is a wrapper around the balancerStop command.

If a balancing round is in progress, the operation waits for balancing to complete.

Tip

See also:

←  sh.status()sh.waitForBalancer() →

On this page

Share Feedback
© 2022 MongoDB, Inc.

About

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