Homework 1.6 - "replSetInitiate quorum check failed" while initiating replica set

hello Everyone,
Although I have been searched for any similar issue as mine and applied whatever it has been suggested to, I am still getting the following error when initiating my replicate set ( all other steps have been completed successfully ).
Any reply is really appreaciated. Thanks Alex.

*** MongoD sessions:

vagrant@database:~$ ps -ef | grep mongod
vagrant 5830 1 1 03:57 ? 00:00:02 mongod --auth --setParameter authenticationMechanisms=PLAIN --setParameter saslauthdPath=/var/run/saslauthd/mux --dbpath /home/vagrant/HW-1.6/r0 --logpath /home/vagrant/HW-1.6/r0/mongo.log.log --port 31160 --replSet HW-1.6 --fork
vagrant 5861 1 1 03:57 ? 00:00:02 mongod --auth --setParameter authenticationMechanisms=PLAIN --setParameter saslauthdPath=/var/run/saslauthd/mux --dbpath /home/vagrant/HW-1.6/r1 --logpath /home/vagrant/HW-1.6/r1/mongo.log.log --port 31161 --replSet HW-1.6 --fork
vagrant 5892 1 2 03:57 ? 00:00:02 mongod --auth --setParameter authenticationMechanisms=PLAIN --setParameter saslauthdPath=/var/run/saslauthd/mux --dbpath /home/vagrant/HW-1.6/r2 --logpath /home/vagrant/HW-1.6/r2/mongo.log.log --port 31162 --replSet HW-1.6 --fork

**
** Etc/hosts
**

vagrant@database:~$ sudo vi /etc/hosts
127.0.0.1 database.m310.mongodb.university database
192.168.31.100 database.m310.mongodb.university database

**
** When trying to add other members of the replica set ( Primary okay )
**

MongoDB Enterprise HW-1.6:PRIMARY> rs.add({host:“database:31161”});
{
“ok” : 0,
“errmsg” : “Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: database:31160; the following nodes did not respond affirmatively: database:31161 failed with not authorized on admin to execute command { replSetHeartbeat: “HW-1.6”, pv: 1, v: 2, from: “database:31160”, fromId: 0, checkEmpty: false }”,
“code” : 74
}

**
** Initiating altogether
**

MongoDB Enterprise > rs.initiate({
… _id: ‘HW-1.6’,
… members: [
… { _id: 1, host: ‘database.m310.mongodb.university:31160’ },
… { _id: 2, host: ‘database.m310.mongodb.university:31161’ },
… { _id: 3, host: ‘database.m310.mongodb.university:31162’ }
… ]
… })
{

{
“ok” : 0,
“errmsg” : “replSetInitiate quorum check failed because not all proposed set members responded affirmatively: database.m310.mongodb.university:31161 failed with not authorized on admin to execute command { replSetHeartbeat: “HW-1.6”, pv: 1, v: 1, from: “database.m310.mongodb.university:31160”, fromId: 1, checkEmpty: true }, database.m310.mongodb.university:31162 failed with not authorized on admin to execute command { replSetHeartbeat: “HW-1.6”, pv: 1, v: 1, from: “database.m310.mongodb.university:31160”, fromId: 1, checkEmpty: true }”,
“code” : 74

1 Like

Hi i got the same error now i try to setup the RS without --auth and after configuring it restart the nodes
i got node is recovering tried to set up with FQDN also errors. everything fine until adding teh nodes to configuration.

Please help
Regards ralf

Hello alexsphino
internal authentication with keyfile helps.
I think RS wants to use LDAP for internal authentiation and this is not configured at all.

Regards Ralf

2 Likes

hello @Ralf_09970.
It seems to be a good catch. I will work on it this evening and let you know the outcome.

hey @Ralf_09970, it was a really good catch, indeed.
Thank you.

By the way, does anybody know whether is there any way to check what is the authentication mechanism in place for the mongo instance? ( Let’s say by using the command line )

According to $ ps -ef | grep mongod , the authentication is

–setParameter authenticationMechanisms=PLAIN

Sorry @trungEdm, that was poor phrasing on my part.
I meant via mongo shell.
Thanks anyway.

Thanks. I was having the same problem. Started all 3 with --auth and --keyfile and it worked.

1 Like