replSetMaintenance
정의
replSetMaintenance
The
replSetMaintenance
admin command enables or disables the maintenance mode for a 보조 member of a replicaSet.
호환성
이 명령은 다음 환경에서 호스팅되는 배포에서 사용할 수 있습니다.
MongoDB Atlas: 클라우드에서의 MongoDB 배포를 위한 완전 관리형 서비스
중요
이 명령은 M0, M2, M5, M10+ 및 Flex 클러스터에서 지원되지 않습니다. 자세한 내용은 지원되지 않는 명령을 참조하세요.
MongoDB Enterprise: MongoDB의 구독 기반 자체 관리 버전
MongoDB Community: MongoDB의 소스 사용 가능 무료 자체 관리 버전
구문
명령은 다음과 같은 구문을 가집니다:
db.runCommand( { replSetMaintenance: <boolean> } )
행동
Consider the following behavior when running the
replSetMaintenance
command:
You cannot run the command on the Primary.
You must run the command against the
admin
database.When enabled
replSetMaintenance: true
, the member enters theRECOVERING
state. While the secondary isRECOVERING
:The member is not accessible for read operations.
The member continues to sync its oplog from the Primary.
When a node receives a
replSetMaintenance: true
request, it adds a maintenance mode task to a queue of tasks. If the queue of tasks was empty and now is not, the node will transition toRECOVERING
state and begin to reject read requests. When a node receives areplSetMaintenance: false
request, it removes a maintenance mode task from the queue (even if that task was initiated by a different client). If the request empties the maintenance mode task queue, the node will return toSECONDARY
state.If you want to prevent a node from servicing reads, consider using 숨겨진 복제본 세트 멤버를 참조하십시오. instead.