0

Deploying NodeBB with MongoDb cluster on Atlas Mongodb.

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: "socket.io", capped: true, size: 5242880 }"

My config.json

{
    "url": "http://localhost:4567",
    "secret": "dc0b3fff-4312-1234-4321-e5a327824225",
    "database": "mongo",
    "port": "4567",
    "mongo": {
        "host": "cluster0-shard-00-00-z1243.mongodb.net,cluster0-shard-00-01-z1234.mongodb.net,cluster0-shard-00-02-z1234.mongodb.net",
        "port": "27017,27017,27017",
        "username": "dbUser",
        "password": "1234123412341234",
        "database": "somedbname",
        "uri": "mongodb+srv://dbUser:1234123412341234@cluster0-z1234.mongodb.net/somedbname?retryWrites=true"
    }
}

Have experimented with the direct changes to the mongodb connection parameters in the mongo.js file

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

Have also passed these there parameters as http query params on the connection uri.

  • 1
    It looks like you are trying to create the socket.io collection in the admin database, which is not directly writeable in MongoDB Atlas. You can specify the database name in your connection string or select after connecting. The Atlas documentation includes Driver Examples. Note: I also provided this suggestion when you posted the same question a few weeks ago on Stack Overflow. If that didn't address your issue, please edit your question to show what you have tried. – Stennie May 8 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.