Para agentes de IA: um índice de documentação está disponível em https://www.mongodb.com/pt-br/docs/llms.txt — as versões de markdown de todas as páginas estão disponíveis anexando .md a qualquer caminho de URL.
Menu Docs

Estados-membros do conjunto de réplicas

Cada membro de um conjunto de réplicas tem um estado.

Número
Nome
Descrição do estado

0

Not yet an active member of any set. All members start up in this state. The mongod parses the replica set configuration document while in STARTUP.

1

O membro no estado primário é o único membro que pode aceitar operações de gravação. Elegível para votar.

2

Um membro no estado secundário está replicando o armazenamento de dados. Elegível para votar.

3

Os membros realizam autoverificações de inicialização ou fazem a transição após a conclusão de um rollback ou ressincronização. Não há dados disponíveis para leituras deste membro. Elegível para votar.

5

O membro está executando uma sincronização inicial. Elegível para votar, exceto quando adicionado recentemente ao conjunto de réplicas.

6

O estado do membro, como visto de outro membro do conjunto, ainda não é conhecido.

7

Os árbitros não replicam dados e existem apenas para participar de eleições. Elegível para votar.

8

O membro, como visto de outro membro do conjunto, não está acessível.

9

Este membro está executando ativamente uma reversão. Elegível para votar. Os dados não estão disponíveis para leituras deste membro.

Starting in version 4.2, MongoDB kills all in-progress user operations when a member enters the ROLLBACK state.

10

Este membro já esteve em um conjunto de réplicas, mas foi removido posteriormente.

PRIMARY

Members in PRIMARY state accept write operations. A replica set has at most one primary at a time. [1] A SECONDARY member becomes primary after an election. Members in the PRIMARY state are eligible to vote.

SECONDARY

Members in SECONDARY state 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 the PRIMARY state if the primary becomes unavailable.

ARBITER

Members in ARBITER state 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 the ARBITER state 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.

Consulte Membros do conjunto de réplicas para obter mais informações sobre os estados principais.

STARTUP

Each member of a replica set starts up in STARTUP state. mongod then loads that member's replica set configuration, and transitions the member's state to STARTUP2 or ARBITER. Members in STARTUP are not eligible to vote, as they are not yet a recognized member of any replica set.

STARTUP2

Alterado na versão 5.0.

Each data-bearing member of a replica set enters the STARTUP2 state as soon as mongod finishes 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 STARTUP2 until all data is copied and all indexes are built. Afterwards, the member transitions to RECOVERING.

Newly-added members in STARTUP2 are not eligible to vote and cannot be elected during the initial sync process. Prior to MongoDB 5.0, members in STARTUP2 were eligible to vote.

RECOVERING

A member of a replica set enters RECOVERING state when it is not ready to accept reads. The RECOVERING state can occur during normal operation, and doesn't necessarily reflect an error condition. Members in the RECOVERING state are eligible to vote in elections, but are not eligible to enter the PRIMARY state.

A member transitions from RECOVERING to SECONDARY after replicating enough data to guarantee a consistent view of the data for client reads. The only difference between RECOVERING and SECONDARY states is that RECOVERING prohibits client reads and SECONDARY permits them. SECONDARY state 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 RECOVERING state and requires manual intervention.

ROLLBACK

Whenever 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 ROLLBACK state. Members in the ROLLBACK state are eligible to vote in elections.

Starting in version 4.2, MongoDB kills all in-progress user operations when a member enters the ROLLBACK state.

Os membros em qualquer estado de erro não podem votar.

UNKNOWN

Members that have never communicated status information to the replica set are in the UNKNOWN state.

DOWN

Members that lose their connection to the replica set are seen as DOWN by the remaining members of the set.

REMOVED

Members that are removed from the replica set enter the REMOVED state. When members enter the REMOVED state, the logs will mark this event with a replSet REMOVED message entry.

[1]

Em alguns casos, dois nós em um conjunto de réplicas podem acreditar transitoriamente que são os primários, mas somente um deles poderá realizar gravações com restrição de gravação { w: "majority" }. O nó que consegue realizar gravações { w: "majority" } é o primário atual, e o outro nó é um antigo primário que ainda não reconheceu seu rebaixamento, normalmente devido a uma partição de rede. Quando isso ocorre, os clientes que se conectam ao antigo primário poderão ver dados obsoletos, apesar de terem solicitado uma preferência de leitura primary, e novas gravações no antigo primário acabarão sendo revertidas.

Avalie esta página