Docs 菜单
Docs 主页
/ /

sh.disableMigrations() (mongosh method)

sh.disableMigrations(namespace)

Disables migrations for the specified namespace of the sharded collection. The balancer does not migrate chunks for the collection you pass to sh.disableMigrations() until migrations are re-enabled using sh.enableMigrations(). For more information on chunk migrations, see Manage Sharded Cluster Balancer.

重要

You can only run sh.disableMigrations() on a mongos instance. If you run sh.enableMigrations() on a mongod instance, the method returns an error.

sh.disableMigrations() 方法具有以下参数:

Parameter
类型
说明

namespace

字符串

集合的命名空间

此方法可用于以下环境中托管的部署:

  • MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本

  • MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本

注意

You can verify migration status using sh.status(), which displays the allowMigrations field for each collection.

后退

sh.disableBalancing

在此页面上