【昊鼎王五】对Mongodb中Balancer自动均衡的最有用的操作
关闭Balancer
> use config
> db.settings.update( { _id: "balancer" }, { $set : { stopped: true } } , true ); #禁用分片的自动平衡
> db.printShardingStatus()
开启Balancer
> use admin
> sh.setBalancerState(true) #开启分片的自动平衡
> sh.status()
自定义特定的Balancer(特定时间开启)
> use admin
> db.settings.update({ _id : "balancer" }, { $set : { activeWindow : { start : "21:00", stop : "9:00" } } }, true )
> sh.status()
MongoDB分片Balancer操作指南
本文详细介绍了MongoDB中Balancer自动均衡的操作方法,包括如何关闭和开启Balancer,以及如何自定义Balancer在特定时间区间内工作,为数据库管理员提供实用技巧。
336

被折叠的 条评论
为什么被折叠?



