Graylog connection to mongo

why I’m getting this error no matter what I set monogo to binding IP

Closed connection [connectionId{localValue:4}] to localhost:27017 because there was a socket exception raised by this connection.

MongoDB is not available.

Hell @studioman5150
Not sure , but I would guess it maybe a configuration issue. Is there any more information you can give?

If I change to the IP address of the server on both mongo and graylog it still say the same thing. What other information

graylog config would use and mongo config would be the same, Unless these services are separated.

Yes I tried the 127.0.01 same issue.

Sorry @studioman5150 ,Hard to tell how to troubleshoot your issue with the lack of info. All know is this works for me

#Network interfaces
  port: 27017

mongodb_uri = mongodb://

yes that is how I set it up. I tried localhost and the IP, Same issue.

Have you seen this?

I will try it and I will let you know tomorrow.

1 Like

I try that suggestion, still getting the same error, I can connect to mongo using mongosh

But Graylog cant, So that would mean something is not configured correctly to allow Graylog to connect to MongoDb

In our situation on Rocky 8 we see the following:

$ netstat -an | grep 27017
tcp        0      0*               LISTEN
tcp        0      0         ESTABLISHED
tcp        0      0         ESTABLISHED
tcp        0      0         ESTABLISHED

Telnet opens a connection to mongo listening port

$ telnet 27017
Connected to
Escape character is '^]'.

graylog server.conf

mongodb_uri = mongodb://localhost/graylog
mongodb_max_connections = 1000
mongodb_threads_allowed_to_block_multiplier = 5

And the mongod.conf is as stated by gsmith

1 Like

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