정의
balancerStart밸런서 스레드를 시작합니다. 이 명령은 밸런싱 라운드가 시작될 때까지 기다리지 않습니다.
MongoDB 7.0부터 밸런서를 시작하면 샤딩된 클러스터에 대한 AutoMerger 도 활성화됩니다.
팁
In
mongosh, this command can also be run through thesh.startBalancer()helper method.Helper methods are convenient for
mongoshusers, but they may not return the same level of information as database commands. In cases where the convenience is not needed or the additional return fields are required, use the database command.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
- MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
You can only issue the balancerStart against the admin database on a mongos instance.
명령은 다음과 같은 구문을 가집니다:
db.adminCommand( { balancerStart: 1, maxTimeMS: <number> } )
명령 필드
필드 | 유형 | 설명 |
|---|---|---|
| any | 모든 값. |
| integer | 선택 사항. 밸런서를 활성화하는 데 걸리는 시간 제한. 기본값은 60000밀리초입니다. |
예시
밸런서 스레드를 시작하려면 mongos 인스턴스에 연결하고 다음 명령을 실행합니다.
db.adminCommand( { balancerStart: 1 } )