Closed genericdata closed 3 years ago
Eric -
We have never tested using Single Cell Portal with MongoDB Atlas - we have always deployed our own via Docker on a separate GCP virtual machine that we connect to over an IP address. That being said, if you can connect from the command line to your remote instance, SCP should be able to see it. However, you shouldn't pass the --username
flag as this is configured in config/mongoid.yml
. Since you are not deploying your database as a VM in GCP like we do, you should also pass the same value for MONGO_LOCALHOST
and MONGO_INTERNAL_IP
.
According to the docs for Mongoid, it looks as though they want you to pass the value for a hosted cluster as uri
and not hosts
. You could try editing config/mongoid.yml
and use the syntax they provide.
If you are trying to use MongoDB locally, you will have to do so via Docker and not natively on your machine. Since we mount volumes directly inside the container, we cannot use the --host
networking mode. This means that calling localhost
inside Docker refers to the Docker container itself, and not your local machine. This is why it cannot see mongo
running locally as it has no way of resolving localhost
back to your computer.
I would recommend using the official mongo Docker image if you want to test locally.
Hopefully that will resolve you connection issue. Please let me know if you run into any other issues - we haven't had someone attempt to deploy their own instance in a while, and it would be great to get some feedback on areas where our documentation is out-of-date or incomplete.
Jon
Thank you.
After commenting out all lines under development within config/mongoid.yml
and adding the uri line, I do not get the error.
development:
clients:
default:
uri: mongodb+srv://single_cell:pass@yourcluster.mongodb.net/single_cell_portal_development?retryWrites=true&w=majority
I am attempting to deploy a private instance. I am getting the following error
Mongo::Error::NoServerAvailable: No server is available matching preference
when running:Here is a subset of output after I added
--trace --versbose
to the line insudo -E -u app -H bin/rake -A --verbose --trace RAILS_ENV=$PASSENGER_APP_ENV db:migrate
inrails_local_setup.rb
.My DB is hosted on MongoDB Atlas with the single_cell user created. From my VM I can access the DB using:
I have also attempted to install mongoDB locally on the machine, but the results are the same.
What am I doing wrong? Thank you.