Hello, during the Deploy and Replica set lab, I’m getting an error “Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: localhost:27001; the following nodes did not respond affirmatively: localhost:27002 failed with a Received heartbeat from a member with the same member ID as ourself: 0” I’ve searched several posts that point to an article that I do not have access to, unfortunately. Does anyone have any tips? Here’s the steps I’m taking.
CONFIG FILES:
CONF 1
storage:
dbPath: /var/mongodb/db/1
net:
bindIp: localhost
port: 27001
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/logs/mongod1.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl
CONF 2
storage:
dbPath: /var/mongodb/db/2
net:
bindIp: localhost
port: 27002
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/logs/mongod2.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl
CONF 3
storage:
dbPath: /var/mongodb/db/3
net:
bindIp: localhost
port: 27003
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/logs/mongod3.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl
TERMINAL STEPS **note I am working from 3 terminals nested in the same IDE workspace.
Terminal 1: mongod --port 27001 --config mongod_1.conf
Terminal 1: mongo --port 27001
Terminal 1: rs.initiate()
successfully created localhost:27001 set as primary.
Terminal 1: Create admin
use admin ##swtich to db admin database to create the db admin
db.createUser({
user: “m103-admin”,
pwd: “m103-pass”,
roles: [
{role: “root”, db: “admin”}
]
})
Terminal 1: Exit
##Bye
TERMINAL 2 STEPS
Terminal 2: mongod --port 27002 --config mongod_2.conf
Terminal 2: mongo --port 27002
Terminal 2: rs.initiate()
successfully created localhost:27002 set as primary.
rs.status() indicates RUNNING
DO NOT Close
TERMINAL 3 STEPS
Terminal 3: mongod --port 27003 --config mongod_3.conf
Terminal 3: mongo --port 27003
Terminal 3: rs.initiate()
successfully created localhost:27003 set as primary.
rs.status() indicates RUNNING
DO NOT Close
GO BACK TO TERMINAL 1
TERMINAL 1 steps – log in as admin and start to add the members.
user@m103#: mongo --host “localhost:27001” -u “m103-admin” -p “m103-pass” --authenticationDatabase “admin”
m103-repl:PRIMARY> rs.add(“localhost:27002”)
“Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: localhost:27001; the following nodes did not respond affirmatively: localhost:27002 failed with Received heartbeat from member with the same member ID as ourself: 0”,
Any help would be much appreciated. I’ve tried adding the replica sets from the admin database as well.