Arbiter configuration

Getting error while setup Arbiter configuration
command i using for this : mongod --port 27017 --dbpath /home/mongodb/arb --replSet mongocluster --bind_ip localhost

The error i’m getting :

“ctx”:“monitoring-keys-for-HMAC”,“msg”:“Failed to refresh key cache”,“attr”:{“error”:“NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.”

And in primary node while setup : rs.addArb(“mongoArb:27017”)

I’m getting error on primary node :

{
  “_id” : 4,
  “name” : “MongoArb:27017”,
  “health” : 0,
  “state” : 8,
  “stateStr” : “(not reachable/healthy)”,
  “uptime” : 0,
  “lastHeartbeat” : ISODate(“2022-10-17T13:53:03.212Z”),
  “lastHeartbeatRecv” : ISODate(“1970-01-01T00:00:00Z”),
  “pingMs” : NumberLong(0),
  “lastHeartbeatMessage” : “not running with --replSet”,
  “syncSourceHost” : “”,
  “syncSourceId” : -1,
  “infoMessage” : “”,
  “configVersion” : -1,
  “configTerm” : -1
}

Main error is here : “stateStr” : “(not reachable/healthy)” and “lastHeartbeatMessage” : “not running with --replSet”.

Please help me out to resolve this query. Thanks

Issue could be with your bind_ip param
Give localhost,IP addr|hostname

Thanks for reply.

I have run this command on arbiter server:

mongod --port 27017 --dbpath /var/lib/mongodb/arb --replSet mongocluster --bind_ip localhost,XX.XX.X.X

And getting error after running this command:

"ctx":"conn966","msg":"Authentication failed","attr":{"mechanism":"SCRAM-SHA-1","speculative":false,"principalName":"__system","authenticationDatabase":"local","remote":"10.0.0.11:36982","extraInfo":{},"error":"BadValue: SCRAM-SHA-1 is disallowed for cluster authentication"

Because of this getting error on primary node :

“stateStr” : “(not reachable/healthy)”
{
			"_id" : 4,
			"name" : "Citus1:27017",
			"health" : 0,
			"state" : 6,
			"stateStr" : "(not reachable/healthy)",
			"uptime" : 0,
			"lastHeartbeat" : ISODate("2022-10-18T11:03:44.751Z"),
			"lastHeartbeatRecv" : ISODate("1970-01-01T00:00:00Z"),
			"pingMs" : NumberLong(0),
			"lastHeartbeatMessage" : "",
			"authenticated" : false,
			"syncSourceHost" : "",
			"syncSourceId" : -1,
			"infoMessage" : "",
			"configVersion" : -1,
			"configTerm" : -1
		}

Do you have any idea how to solve this ?

Hi @Sanjay_Soni,

Is mongoArb a resolvable hostname (for example, can you ping mongoArb from a command shell?

“stateStr” : “(not reachable/healthy)”,

This error message indicates the hostname is not resolvable or a mongod is not listening on that host:port combination.

“not running with --replSet

This error message indicates there was a heartbeat from a mongod that is running without the replSet parameter, so it will not be able to join the replica set. Perhaps you started your intended primary without the replSet parameter.

If you only bind to a localhost address, this replica set member will only be able to connect to other members on the same host.

Regards,
Stennie