I’m deploying a Meteor app on Galaxy for the first time and cannot connect to MongoDB Atlas. Somewhere along the way, I saw meteor
in my databases on Atlas, but then recreated my cluster and can’t figure out how I did it the first time.
I can connect to MongoDB through Mongo Shell using the following (provided by MongoDB support):
mongo "mongodb://<host1>:27017,<host2>:27017,<host3>:27017/<db_name>?replicaSet=<replica_set_name>" --ssl --authenticationDatabase admin --username <username> --password <password>
I tried the following equivalent string for the Mongo URL in my settings.json
:
mongodb://<username>:<password>@<host1>:27017,<host2>:27017,<host3>:27017/<db_name>?authSource=admin&replicaSet=<replica_set_name>
But when I deploy my app, I get:
Error: Could not locate any valid servers in initial seed list
.
I’ve also tried using the connection string provided by Atlas (also matching Deploy app - Galaxy and Atlas:Mongodb):
mongodb+srv://<username>:<password>@<host>/<db_name>?retryWrites=true&w=majority
But this just returns:
Error: URL must be in the format mongodb://user:pass@host:port/dbname
I don’t know if Galaxy is not recognizing the"+srv" but that always results in an “incorrect format” error.