MongoDB 7.0 기준.

 

 

namespace별로 balancer 구동여부를 설정할 수 있음.

// 사전 변수세팅
ns = 'DB_NAME.COLLECTION_NAME'
config = db.getSiblingDB('config')
 
// disable
sh.disableBalancing(ns)
 
// 확인 (true 이므로 disabled)
config.collections.findOne({_id: ns}).noBalance
true
 
// enable
sh.enableBalancing(ns)
 
// 확인 (false 이므로 enabled)
config.collections.findOne({_id: ns}).noBalance
false

 

 

[참고]

https://www.mongodb.com/docs/manual/tutorial/manage-sharded-cluster-balancer/#disable-balancing-on-a-collection

 

 

 

 

 

 

 

 

Posted by bloodguy
,