Is Nodebb supporting Atlas Mongodb clusters?

Technical Support
  • #1

    Setting up a cluster on Atlas Mongodb.

    My config

        "url": "http://localhost:4567",
        "secret": "dc0b3fff-4312-1234-4321-e5a327824225",
        "database": "mongo",
        "port": "4567",
        "mongo": {
            "host": ",,",
            "port": "27017,27017,27017",
            "username": "dbUser",
            "password": "1234123412341234",
            "database": "somedbname",
            "uri": "mongodb+srv://dbUser:[email protected]/somedbname?retryWrites=true"

    Changes in the mongo.js file

    ssl: true,
    authSource: 'admin',
    replicaSet: 'Cluster0-shard-0',

    I can successfully complete the .\nodebb setup command.
    It also works as expected against local instance of Mongodb but when I run it against Atlas cluster I get:

    not authorized on admin to execute command { create: "", capped: true, size: 5242880 }"

  • Global Moderator Plugin & Theme Dev

    @maciejso you shouldn't need to modify any files if you have only the uri property in the mongo object in config.json (assuming the URI is correct)

    Have you tried googling that error? It seems that when nodebb attempts to create a collection, it doesn't have the necessary privileges. Perhaps trying giving the user that nodebb is using more privileges, or creating that collection or whatever manually?

  • #3

    Thanks for the answer.

    Changing the mongodb params came from earlier posts on the forum

    I take that I could as well include them directly in the config.sjon as parameters to the uri query.

    Yes, I did spend hours on googling this and similar error messages.

    No, you can't create any collection manually on admin on MongoDb Atlas.
    Neither from CLI nor from web interface.
    Have upgraded from M0 to M2 just to see if there would be any impact but it isn't.

    The most interesting thing is that the collection on admin was not created on local instance in order to get the nodebb to run. I am able to create it locally but setup did not create it.

  • #4

    @maciejso Anyone with a solution to this?! Wth!?

Suggested Topics

  • 0 Votes
    7 Posts

  • Mongodb authorisation

    Technical Support
    0 Votes
    3 Posts

  • 1 Votes
    10 Posts

  • 0 Votes
    3 Posts

  • 0 Votes
    4 Posts

| | | |