Balancer介紹:
當存在多個可用的分片,且塊的數量足夠多,MongoDB的balancer(平衡器)會把數據遷移到其他分片上
指定凌晨0點到4點之間均衡:
在mongos節點,use config
>db.settings.update({ _id : "balancer" }, { $set : { activeWindow : { start : "00:00", stop : "4:00" } } }, true )
刪除指定的時間段:
在mongos節點,use config
>db.settings.update({ _id : "balancer" }, { $unset : { activeWindow : true })
禁用Balancer:
>sh.stopBalancer()
啟用Balancer:
>sh.startBalancer()
新聞標題:MongoDBShardingBalancer介紹和設置方法舉例
網站鏈接:
http://www.xueling.net.cn/article/pdicsh.html