I am attempting to setup a 3 node replica set.
Alll 3 mongod are running on separate hosts and name resolution configured vi /etc/hosts on all nodes.
I created mongo-admin, mongo-root and cluster-admin users in the admin db on node1.
Authentication is enabled in the mongod.conf on each node.
I was able run rs.initiate() on the first node ok wihtout issue. logged in as (mongo-root)
Now when trying to adding the other nodes with rs.add I am getting below error?
MongoDB Enterprise rep1:PRIMARY> rs.add(“mongodb02.test.int”)
{
“operationTime” : Timestamp(1558367519, 1),
“ok” : 0,
“errmsg” : “Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: mongodb01.test.int:27017; the following nodes did not respond affirmatively: mongodb02.test.int:27017 failed with Authentication failed.”,
“code” : 74,
“codeName” : “NodeNotFound”,
“$clusterTime” : {
“clusterTime” : Timestamp(1558367519, 1),
“signature” : {
“hash” : BinData(0,“ABmzlIOz94CegUlFfqsWYjSK3gw=”),
“keyId” : NumberLong(“6692111607595532289”)
}
}
}
I tried running rs.add while logged in as cluster-admin which has clusterAdmin role but still I get same error?