복제본 집합의 각 멤버에는 상태가 있습니다.
번호 | 이름 | 상태 설명 |
|---|---|---|
0 | Not yet an active member of any set. All members start up in this state. The | |
1 | 상태 프라이머리의 멤버는 쓰기 작업을 수락할 수 있는 유일한 멤버입니다. 투표할 수 있습니다. | |
2 | state secondary 의 멤버가 데이터 저장소를 복제하고 있습니다. 투표할 수 있는 자격이 있습니다. | |
3 | ||
5 | 멤버가 초기 동기화를 실행 중입니다. 복제본 세트에 새로 추가된 경우를 제외하고 투표할 수 있습니다. | |
6 | 세트의 다른 멤버에서 본 멤버의 상태는 아직 알려지지 않았습니다. | |
7 | 중재자는 데이터를 복제하지 않으며 오로지 선거에 참여하기 위해 존재합니다. 투표할 수 있는 자격이 있습니다. | |
8 | 세트의 다른 멤버에서 볼 수 있듯이 해당 멤버에 연결할 수 없습니다. | |
9 | ||
10 | 이 구성원은 한때 복제 세트에 있었지만 나중에 제거되었습니다. |
주
핵심 상태
PRIMARYPRIMARY상태 의 멤버는 쓰기 (write) 작업을 허용합니다. 복제본 세트 한 번에 최대 하나 프라이머리 있습니다. [1]SECONDARY회원이 투표 후 프라이머리 됩니다.PRIMARY상태 회원은 투표할 수 있습니다.
SECONDARYMembers in
SECONDARYstate replicate the primary's data set and can be configured to accept read operations. Secondaries are eligible to vote in elections, and may be elected to thePRIMARYstate if the primary becomes unavailable.
ARBITERMembers in
ARBITERstate do not replicate data or accept write operations. They are eligible to vote, and exist solely to break a tie during elections. Replica sets should only have a member in theARBITERstate if the set would otherwise have an even number of voting members, and could suffer from tied elections. There should only be at most one arbiter configured in any replica set. For considerations when using an arbiter, see Replica Set Arbiter.
코어 상태에 대한 자세한 내용은 Replica Set Members를 참조하십시오.
기타 주
STARTUPEach member of a replica set starts up in
STARTUPstate.mongodthen loads that member's replica set configuration, and transitions the member's state toSTARTUP2orARBITER. Members inSTARTUPare not eligible to vote, as they are not yet a recognized member of any replica set.
STARTUP2버전 5.0에서 변경되었습니다.
Each data-bearing member of a replica set enters the
STARTUP2state as soon asmongodfinishes loading that member's configuration.The member then decides whether or not to undertake an initial sync. If a member begins an initial sync, the member remains in
STARTUP2until all data is copied and all indexes are built. Afterwards, the member transitions toRECOVERING.에 새로 추가된 멤버는 투표할 수 없으며 초기 동기화 프로세스 중에 선출될 수 없습니다.
STARTUP2MongoDB 5 이전에는.0 의 회원만STARTUP2투표할 수 있었습니다.
RECOVERINGA member of a replica set enters
RECOVERINGstate when it is not ready to accept reads. TheRECOVERINGstate can occur during normal operation, and doesn't necessarily reflect an error condition. Members in theRECOVERINGstate are eligible to vote in elections, but are not eligible to enter thePRIMARYstate.A member transitions from
RECOVERINGtoSECONDARYafter replicating enough data to guarantee a consistent view of the data for client reads. The only difference betweenRECOVERINGandSECONDARYstates is thatRECOVERINGprohibits client reads andSECONDARYpermits them.SECONDARYstate does not guarantee anything about the staleness of the data with respect to the primary.Due to overload, a secondary may fall far enough behind the other members of the replica set such that it may need to resync with the rest of the set. When this happens, the member enters the
RECOVERINGstate and requires manual intervention.
ROLLBACKWhenever the replica set replaces a primary in an election, the old primary may contain documents that did not replicate to the secondary members. In this case, the old primary member reverts those writes. During rollback, the member will have
ROLLBACKstate. Members in theROLLBACKstate are eligible to vote in elections.Starting in version 4.2, MongoDB kills all in-progress user operations when a member enters the
ROLLBACKstate.
오류 상태
오류 상태의 회원은 투표할 수 없습니다.
UNKNOWNMembers that have never communicated status information to the replica set are in the
UNKNOWNstate.
DOWNMembers that lose their connection to the replica set are seen as
DOWNby the remaining members of the set.
REMOVEDMembers that are removed from the replica set enter the
REMOVEDstate. When members enter theREMOVEDstate, the logs will mark this event with areplSet REMOVEDmessage entry.
| [1] | 일부 상황에서는 복제본 세트의 두 노드가 일시적으로 자신이 주 노드라고 생각할 수 있지만, |