Graylog cluster issue

Graylog Version: 4.0.7
MongoDB: 4.2
ElasticSearch: 7.9 (AWS Managed)

3 node setup. 1 with is_master = true and other two is_master = false

MongoDB replication went smooth but while setting up graylog cluster I see following error.

[cluster] Cluster description not yet available. Waiting for 30000 ms before timing out

ERROR: Unable to connect to MongoDB. Is it running and the configuration correct?
Details: Command failed with error 10107 (NotWritablePrimary): ‘not master’ on server localhost:27017. The full response is {“operationTime”: {"$timestamp": {“t”: 1621523185, “i”: 3}}, “ok”: 0.0, “errmsg”: “not master”, “code”: 10107, “codeName”: “NotWritablePrimary”, “$clusterTime”: {“clusterTime”: {"$timestamp": {“t”: 1621523185, “i”: 3}}, “signature”: {“hash”: {"$binary": “AAAAAAAAAAAAAAAAAAAAAAAAAAA=”, “$type”: “00”}, “keyId”: {"$numberLong": “0”}}}}

Need further help?

** Community support: https://www.graylog.org/community-support/*
** Commercial support: https://www.graylog.com/technical-support/*

Terminating. :frowning:

Mongo status:
Mongo is able to connect from all nodes. Have added the 3 hostname with ip in /etc/hosts of all nodes.

*rs01:PRIMARY> rs.status();*
*{*
*        "set" : "rs01",*
*        "date" : ISODate("2021-05-21T09:10:21.714Z"),*
*        "myState" : 1,*
*        "term" : NumberLong(4),*
*        "syncingTo" : "",*
*        "syncSourceHost" : "",*
*        "syncSourceId" : -1,*
*        "heartbeatIntervalMillis" : NumberLong(2000),*
*        "majorityVoteCount" : 2,*
*        "writeMajorityCount" : 2,*
*        "optimes" : {*
*                "lastCommittedOpTime" : {*
*                        "ts" : Timestamp(1621588221, 3),*
*                        "t" : NumberLong(4)*
*                },*
*                "lastCommittedWallTime" : ISODate("2021-05-21T09:10:21.269Z"),*
*                "readConcernMajorityOpTime" : {*
*                        "ts" : Timestamp(1621588221, 3),*
*                        "t" : NumberLong(4)*
*                },*
*                "readConcernMajorityWallTime" : ISODate("2021-05-21T09:10:21.269Z"),*
*                "appliedOpTime" : {*
*                        "ts" : Timestamp(1621588221, 3),*
*                        "t" : NumberLong(4)*
*                },*
*                "durableOpTime" : {*
*                        "ts" : Timestamp(1621588221, 3),*
*                        "t" : NumberLong(4)*
*                },*
*                "lastAppliedWallTime" : ISODate("2021-05-21T09:10:21.269Z"),*
*                "lastDurableWallTime" : ISODate("2021-05-21T09:10:21.269Z")*
*        },*
*        "lastStableRecoveryTimestamp" : Timestamp(1621588208, 2),*
*        "lastStableCheckpointTimestamp" : Timestamp(1621588208, 2),*
*        "electionCandidateMetrics" : {*
*                "lastElectionReason" : "stepUpRequestSkipDryRun",*
*                "lastElectionDate" : ISODate("2021-05-20T15:32:15.244Z"),*
*                "electionTerm" : NumberLong(4),*
*                "lastCommittedOpTimeAtElection" : {*
*                        "ts" : Timestamp(1621524732, 1),*
*                        "t" : NumberLong(3)*
*                },*
*                "lastSeenOpTimeAtElection" : {*
*                        "ts" : Timestamp(1621524732, 1),*
*                        "t" : NumberLong(3)*
*                },*
*                "numVotesNeeded" : 2,*
*                "priorityAtElection" : 1,*
*                "electionTimeoutMillis" : NumberLong(10000),*
*                "priorPrimaryMemberId" : 1,*
*                "numCatchUpOps" : NumberLong(0),*
*                "newTermStartDate" : ISODate("2021-05-20T15:32:15.250Z"),*
*                "wMajorityWriteAvailabilityDate" : ISODate("2021-05-20T15:32:16.259Z")*
*        },*
*        "members" : [*
*                {*
*                        "_id" : 0,*
*                        "name" : "10.80.1.44:27017",*
*                        "health" : 1,*
*                        "state" : 1,*
*                        "stateStr" : "PRIMARY",*
*                        "uptime" : 63758,*
*                        "optime" : {*
*                                "ts" : Timestamp(1621588221, 3),*
*                                "t" : NumberLong(4)*
*                        },*
*                        "optimeDate" : ISODate("2021-05-21T09:10:21Z"),*
*                        "syncingTo" : "",*
*                        "syncSourceHost" : "",*
*                        "syncSourceId" : -1,*
*                        "infoMessage" : "",*
*                        "electionTime" : Timestamp(1621524735, 1),*
*                        "electionDate" : ISODate("2021-05-20T15:32:15Z"),*
*                        "configVersion" : 123251,*
*                        "self" : true,*
*                        "lastHeartbeatMessage" : ""*
*                },*
*                {*
*                        "_id" : 1,*
*                        "name" : "kcloud-graylog-node1-10-80-0-32:27017",*
*                        "health" : 1,*
*                        "state" : 2,*
*                        "stateStr" : "SECONDARY",*
*                        "uptime" : 63474,*
*                        "optime" : {*
*                                "ts" : Timestamp(1621588220, 2),*
*                                "t" : NumberLong(4)*
*                        },*
*                        "optimeDurable" : {*
*                                "ts" : Timestamp(1621588220, 2),*
*                                "t" : NumberLong(4)*
*                        },*
*                        "optimeDate" : ISODate("2021-05-21T09:10:20Z"),*
*                        "optimeDurableDate" : ISODate("2021-05-21T09:10:20Z"),*
*                        "lastHeartbeat" : ISODate("2021-05-21T09:10:20.557Z"),*
*                        "lastHeartbeatRecv" : ISODate("2021-05-21T09:10:21.124Z"),*
*                        "pingMs" : NumberLong(0),*
*                        "lastHeartbeatMessage" : "",*
*                        "syncingTo" : "kcloud-graylog-node2-10-80-3-229:27017",*
*                        "syncSourceHost" : "kcloud-graylog-node2-10-80-3-229:27017",*
*                        "syncSourceId" : 3,*
*                        "infoMessage" : "",*
*                        "configVersion" : 123251*
*                },*
*                {*
*                        "_id" : 3,*
*                        "name" : "kcloud-graylog-node2-10-80-3-229:27017",*
*                        "health" : 1,*
*                        "state" : 2,*
*                        "stateStr" : "SECONDARY",*
*                        "uptime" : 63538,*
*                        "optime" : {*
*                                "ts" : Timestamp(1621588220, 3),*
*                                "t" : NumberLong(4)*
*                        },*
*                        "optimeDurable" : {*
*                                "ts" : Timestamp(1621588220, 3),*
*                                "t" : NumberLong(4)*
*                        },*
*                        "optimeDate" : ISODate("2021-05-21T09:10:20Z"),*
*                        "optimeDurableDate" : ISODate("2021-05-21T09:10:20Z"),*
*                        "lastHeartbeat" : ISODate("2021-05-21T09:10:20.986Z"),*
*                        "lastHeartbeatRecv" : ISODate("2021-05-21T09:10:21.188Z"),*
*                        "pingMs" : NumberLong(1),*
*                        "lastHeartbeatMessage" : "",*
*                        "syncingTo" : "10.80.1.44:27017",*
*                        "syncSourceHost" : "10.80.1.44:27017",*
*                        "syncSourceId" : 0,*
*                        "infoMessage" : "",*
*                        "configVersion" : 123251*
*                }*
*        ],*
*        "ok" : 1,*
*        "$clusterTime" : {*
*                "clusterTime" : Timestamp(1621588221, 3),*
*                "signature" : {*
*                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),*
*                        "keyId" : NumberLong(0)*
*                }*
*        },*
*        "operationTime" : Timestamp(1621588221, 3)*
*}*

Any help would be really appreciated.

@kaamth0aesi
Hello

If you could when posting configuration using the editor in Markdown. This will improve readability with better formatting.

.You connecting with any user/password credentials?
Do you have the correct ports opened?

Hi @gsmith

Thanks for addressing and I’ll follow up with the readability part.

To answer your question:
1)Yes, it’s connected with username and password
2)Yes, port 27017 is opened for all nodes

I have tested the connectivity from all three nodes using the credentials

Is it possible to see your Graylog and MongoDb config file?
EDIT:
On ALL your Graylog config files do you have this section configured?

 mongodb_uri = Mongodb://grayloguser:secret@localhost:27017,localhost:27018,localhost:27019/graylog?replicaSet=rs01

The reason I ask is because of this following statement.

Resolved it. It was my mistake. Instead of mongodb_uri , I did typo mongodb_url

How do I close this ticket. Thanks again.

Glad you resolved it :slight_smile:
It will close in 14 day from the last post.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.