Hello,
I am new to this forum.
I am more in an admin role of graylog app on 3 nodes, that is using mongodb replica.
mongodb replica was running fine for more than a year. Then we did some smaller upgrade of graylog sw, probably somethng else was done with mongo-not sure, but now I have a problem and I suspect it is mongodb related.
All users and app config is stored in mongodb. If I run graylog app on NODE1 it starts,
but it shows no users, no config, all is missing.
If I run graylog on the other node, NODE3, it still show fine users and config.
I suspect somethig is wrong on the mongodb lebvel, but I cann not reall debug it properly.
some details: here is how nodes connect to replica:
mongodb_uri = mongodb://192.158.20.100/graylog,192.158.20.101/graylog,192.158.20.102/graylog?replicaSet=reproduk
now if I log to NODE1(192.158.20.100) and run mongo, it shows me:
produk:PRIMARY> show dbs
graylog 0.028GB
graylog,192 0.002GB
local 0.313GB
I never before saw this strange db “graylog,192”
192 is actually the first part of IP
If I run the same command on the only node still runing ok, node3, I get ERROR:
reproduk:SECONDARY> show dbs
2020-09-21T14:27:51.126+0200 E QUERY [thread1] Error: listDatabases failed:{ "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435 } :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
Mongo.prototype.getDBs@src/mongo/shell/mongo.js:62:1
shellHelper.show@src/mongo/shell/utils.js:769:19
shellHelper@src/mongo/shell/utils.js:659:15
@(shellhelp2):1:1
But if I run commands like rs.conf() or rs.status() I get practically the same working result on both node1 and node 3:
reproduk:SECONDARY> rs.status()
{
"set" : "reproduk",
"date" : ISODate("2020-09-21T12:37:04.748Z"),
"myState" : 2,
"term" : NumberLong(65),
"syncingTo" : "192.158.20.100:27017",
"heartbeatIntervalMillis" : NumberLong(2000),
"members" : [
{
"_id" : 0,
"name" : "192.158.20.100:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 2625358,
"optime" : {
"ts" : Timestamp(1600691823, 20),
"t" : NumberLong(65)
},
"optimeDate" : ISODate("2020-09-21T12:37:03Z"),
"lastHeartbeat" : ISODate("2020-09-21T12:37:03.658Z"),
"lastHeartbeatRecv" : ISODate("2020-09-21T12:37:03.128Z"),
"pingMs" : NumberLong(0),
...
Any pointers how could I continue my debugging ?
Maybe deleting this collection graylog,192 ?