MongoDB authentication

Hi

I am trying to run graylog with an authentication on MongoDB. Firstly I have set up the mongo image like so:

Now to connect to mongo I initially thought that I needed to set include the username and password in the username above inside the GRAYLOG_DATANODE_MONGODB_URI and GRAYLOG_MONGODB_URI, and I did it like so:

But that did not work. So after looking a little more into it. I decided I first needed to create the graylog database within mongo, then assign a user to that database and use those credentials. The image below shows the ‘graylog’ database being made and the user being created for it.

I then used the uri of “mongodb://test:test@localhost:27017/graylog”, and that still did not work.

The same errors occurred both times which were



image

Not too sure where to go from here, so any direction would be amazing.

Thanks

Hello @mromeo,

What if you try using the hostname of mongo container for the options GRAYLOG_MONGODB_URI and GRAYLOG_DATANODE_MONGODB_URI?

mongodb://test:test@mongodb:27017/graylog"
1 Like

Thank you, yes that fixed the problem

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