定义
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 usingsh.enableMigrations(). For more information on chunk migrations, see Manage Sharded Cluster Balancer.重要
You can only run
sh.disableMigrations()on amongosinstance. If you runsh.enableMigrations()on amongodinstance, 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.