[SOLVED] Mongodb version - Error nodejs error ReplicaSetNoPrimary

I am using meteor version 2.12 with mongodb 6.0.5 …one one server. Now I want to separate DB and I installed mongodb 6.0.8, but for some reason meteor is refusing connection. Does meteor driver not support this version of mongodb?

I’m using Meteor 2.12 with separate Mongodb database (localhost) 6.0.8 without any problem. What is your MONGO_URL? Can you connect to your database using other program likes Mongodb Compass?

Thanks @minhna for confirming.

I can connect using mongosh (the same string I pass to MONGO_URL)…but not via meteor it refuses to connect. Now since mongodb version is not an issue. I will check if some setting I am missing.

I use pm2 to bringup meteor.

I wanted to update this so that it can help somebody when connecting to own remote mongodb server

reference to this at

generally while setting up mongodb we setup the replica set for oplog. This by default takes the local address, while on the connection string in meteor we specify the ip of the mongodb server. This mismatch leads to connection being denied

the way to set it correctly is in the mongodb link which I have pasted below

in the mongo shell

cfg = rs.conf()
cfg.members[0].host = "mongodb0.example.net:27017"
rs.reconfig(cfg)

where you replace mongodb0.example.net with your mongodb server ip