Hi there:
I connected to a node that is supposed to be a secondary one (not sure if being 2 or 3 means it’s an actual secondary node, but…) and shut it down:
mongod --config /shared/mongod-repl-2.conf
mongo --host "192.168.103.100:27002" -u "m103-admin" -p "m103-pass" --authenticationDatabase "admin"
use admin
db.shutdownServer()
quit()
Then I tried to connect to the one I guess it’s the primary, i.e. 1:
mongod --config /shared/mongod-repl-1.conf
mongo --host "192.168.103.100:27001" -u "m103-admin" -p "m103-pass" --authenticationDatabase "admin"
But when the prompt appears…
MongoDB Enterprise m103-repl:SECONDARY>
So when I try to initiate the replica set:
rs.initiate()
I get this:
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "192.168.103.100:27001",
"info" : "try querying local.system.replset to see current configuration",
"ok" : 0,
"errmsg" : "already initialized",
"code" : 23,
"codeName" : "AlreadyInitialized",
"operationTime" : Timestamp(1573675455, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1573675455, 1),
"signature" : {
"hash" : BinData(0,"JaBwUlZclM5OLHn/BepeE5zbwaI="),
"keyId" : NumberLong("6758783797975580674")
}
}
}
I don’t know what it means, but it doesn’t look good.
If I check the status:
rs.status()
I get:
"name" : "192.168.103.100:27001",
"stateStr" : "SECONDARY",
Why?
"name" : "192.168.103.100:27002",
"stateStr" : "(not reachable/healthy)",
I was expecting this, OK.
"name" : "m103:27003",
"stateStr" : "(not reachable/healthy)",
Why??
I guess it’s related to the previous lab, but I passed it (or at least I got the code).