Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

272
Visualizações
mongodb replica sets -all nodes recovering

i am using a simple mongodb replica set configuration. i have one primary and two secondaries. every thing was fine until i planned to add access control to the mongodb instances.(i know how to add it)

i close down all mongod instances and when i restarted them , all the nodes went into RECOVERING state. i noticed when any (only one at a time) instance is running the state changes to SECONDARY. now to add access controll (use access) i have to be in PRIMARY node which cant come up because as soon as i start all the instances all go into RECOVERING state.

why is this happening? EDIT1: size of database is 700 Mb

EDIT2: i managed to bring back them to a consistent state , it was because i think before i had different settings in mongod.conf file. now i have two secondaries and one primary. now i want to add use access control how should i go about it so that nodes don't go into inconsistent state again.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The solution for me was to use keyFile authentication. So instead of:

security:
    authorization: enabled

use:

security:
  keyFile: <path-to-keyfile>

Basically I followed the instructions at:

https://docs.mongodb.com/manual/tutorial/enforce-keyfile-access-control-in-existing-replica-set

This guarantees a few things:

  1. It simultaneously enforces internal authentication (communication between replicas) and user access control
  2. With keyfile authentication, each mongod instances in the replica set uses the contents of the keyfile as the shared password for authenticating other members in the deployment. Only mongod instances with the correct keyfile can join the replica set.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda