In MongoDB server version: 3.4.16 we are able to get the data via arbiter node but in same environment but MongoDB server version: v3.6.9, it is throwing error. Any reason, why? No config of replica set is changed
MongoDB shell version v3.6.9
# mongo --host xxx.xxx.xxx.xx --port xxxxx --ipv6 --eval 'printjson(rs.status())'
MongoDB shell version v3.6.9
connecting to: mongodb://xxx.xxx.xxx.xx:xxxxx/
Implicit session: session { "id" : UUID("xxxxx-xxxxx-xxxxx-xxxxx-xxxxx") }
MongoDB server version: 3.6.9
{
"ok" : 0,
"errmsg" : "not authorized on admin to execute command { replSetGetStatus: 1.0, lsid: { id: UUID(\"xxxxx-xxxxx-xxxxx-xxxxx-xxxxx\") }, $db: \"admin\" }",
"code" : 13,
"codeName" : "Unauthorized"
}
MongoDB shell version v3.4.16
# mongo --host xxx.xxx.xxx.xx --port xxxxx --ipv6 --eval 'printjson(rs.status())'
MongoDB shell version v3.4.16
connecting to: mongodb://xxx.xxx.xxx.xx:xxxxx/
MongoDB server version: 3.4.16
{
"set" : "set01",
"date" : ISODate("YYYY-MM-DDT17:25:54.460Z"),
"myState" : 7,
"term" : NumberLong(1),
"syncingTo" : "",
"syncSourceHost" : "",
"syncSourceId" : -1,
"heartbeatIntervalMillis" : NumberLong(2000),
"optimes" : {
:
:
:
:
}
},
"members" : [
{
"_id" : 0,
"name" : "hostname0:xxxxx",
"health" : 1,
"state" : 7,
"stateStr" : "ARBITER",
:
:
:
:
},
{
"_id" : 1,
"name" : "hostname1:xxxxx",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
:
:
:
:
},
{
"_id" : 2,
"name" : "hostname2:xxxxx",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 681823,
:
:
:
:
}
],
"ok" : 1
}