Can't config replica set using MongoDB 3
I'm trying to create a replica set in MongoDB version 3.04. I followed this tutorial and getting the next error while trying to add nodes using the primary server:
vacrep:PRIMARY> rs.add('server address here')
{
"ok" : 0,
"errmsg" : "Quorum check failed because not enough voting nodes responded;
required 2 but only the following 1 voting nodes responded: PRIMARYSERVER:27017;
the following nodes did not respond affirmatively: 'server address here':27017
failed with Missing credentials for authenticating as internal user",
"code" : 74
}
This is what been done so far:
- Install 3 servers with MongoDB 3.04
- Run all MongoDB instances with repSet mode
- Verified connectivity between servers using this approach
- Initiate a replica in the primary server)
I found few threads about this error no but couldn't find a solution in any of them. How can I solve this?
Found the solution - It was permission issue.
In MongoDB configuration file, I had to turn off authentication mode or create a shared key between all nodes using this guide:
https://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/#deploy-repl-set-with-auth
This was the reason my servers couldn't communicate each other.