Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!