Connecting to mongoDB on deployed meteor app - mongodb

I recently deployed an app on galaxy using meteor 2.0 and mongo. I deployed using the command meteor deploy <domain>.au.meteorapp.com --free --mongo and it gave me the mongo URL below.
mongodb://<username>:<password>#SG-apgalaxycluster-38734.servers.mongodirector.com:27017,SG-apgalaxycluster-38735.servers.mongodirector.com:27017/<domain>-au-meteorapp-com?replicaSet=RS-apgalaxycluster-0&ssl=true
I cant seem to access this DB on mongo compass as when I paste the connection string in I simply get an error saying self signed certificate
Does anyone know how I can access it?

Related

Getting the Url of a mongo database installed on a linux server

I installed ubuntu server and mongodb on my laptop to run a testserver and everthing works fine.
Now i would like to use the database to store data from a flutter app therefore i need the connection url to the database.
The mongoshell shows the following:
Connecting to:mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1
I don`t know if the url is correct or where can i find it?
Thank you!

MongoDB not working on deployed Meteor project

I've been working on a project with some friends using MongoDB and Meteor. It was working fine until we deployed it, we noticed the Mongo DB was not connecting to the Meteor app.
We are using:
Azure's Virtual Machine server
Meteor for development
Mongo for our database (Hosted in Azure's Document DB, different location from the Meteor's Azure VM)
Meteor up (mup) for deployment
We did notice that when we run the project locally with meteor, we need to specify the MONGO_URL on the same command (MONGO_URL="MongoDB connection string" meteor) if not, it doesn't connect to the db. This may be happening on the website, although we have specified the mongo url in the mup as follows:
env: {
ROOT_URL: 'IP',
MONGO_URL: '<URL>'
},
We have checked everything and not sure how to proceed, any feedback would help.
EDIT: Specify server locations

Cannot access mongoDB after "meteor deploy myapp.com"

I deployed my app using meteor deploy myapp.com, and directed my DNS to myapp.meteor.com.
The app is now available at myapp.com, and I have no problem running it. It's the correct version that was deployed to "myapp.com" and not the older "myapp.meteor.com" version.
But I cannot access mongodb for this deployed version.
When I run meteor mongo myapp.com, I get this at the terminal:
MongoDB shell version: 2.6.7
connecting to: sg-mother1-6242.servers.mongodirector.com:27017/myapp_com
2016-03-10T16:46:18.659-0800 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1210
exception: login failed
I am also getting the same error when I run meteor mongo myapp.meteor.com:
MongoDB shell version: 2.6.7
connecting to: someserver.servers.mongodirector.com:27017/myapp_meteor_com
2016-03-10T16:45:54.367-0800 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1210
exception: login failed
When I do meteor mongo --url myapp.com, I do get a URL back of the form:
mongodb://<user>:<password>#<some-servername>.servers.mongodirector.com:27017/myapp_com
But I cannot connect to this URL using Robomongo. I get an error:
Cannot connect to MongoDB (<some-servername>.servers.mongodirector.com:27017),
error: Unable to connect to MongoDB
What am I doing wrong? How do I connect to the mongoDB for the app I deployed on my custom domain? Preferably using some GUI tool such as Robomongo?
What I understand, is that the local install of Meteor uses Mongodb 2.6 and newly deployed Meteor sites use Mongodb 3.0
When you call meteor mongo myapp.meteor.com you are using meteor's locally installed version of mongo (version 2.6) but you are trying to access the deployed mongodb (version 3.0). This results in the authentication error you are getting.
This link describes a workaround that worked for me. I had to tweak it a little, but this is what I did:
Install or update your local version of Mongo (not through Meteor).
Run the command meteor mongo --url myapp.meteor.com to get the MONGO_URL. As you already mentioned, you'll get something like
mongodb://<user>:<password>#<some-servername>.servers.mongodirector.com:27017/myapp_com
Connect to the MONGO_URL using your updated non-meteor version of mongo by running
mongo mongodb://<user>:<password>#<some-servername>.servers.mongodirector.com:27017/myapp_com
You should now be in the mongoshell, connected to your deployed mongodb. You should see something like this RS-mother1-0:PRIMARY> in your mongo shell. You still need to switch to your app's DB though. So call use myapp_com from the shell.
You should now be able to view collections and run mongo commands on your deployed meteor mongodb.
I'm not sure why you can't connect to Robomongo using the username and password meteor generates for you in the MONGO_URL. I suspect it's because it might expire. If you still want to connect using Robomongo, I'd recommend creating a user on the database now that you are logged in. And then later on, using that user to log into Robomongo.
Creating the user in the mongo shell:
db.createUser({ "user" : "my_user", "pwd": "my_password", "roles" : ["readWrite"]})
New MONGO_URL:
mongodb://my_user:my_password#<some-servername>.servers.mongodirector.com:27017/myapp_com

Parse.com connecting MongoLab URI to Parse Dashboard

I have trouble connecting my mongodb database to Parse Dashboard using the required URI :
mongodb://user:password#dsXXXXX.mongolab.com:XXXXX/my_db?ssl=true
Here is what I get :
I'm completely new to mongdb and mongolab and cannot figure out what's going on.
I using Heroku and MongoLab for Parse,
And the URI I am using, I've got from Heroku app setting page as follows:

How is MongoDb installed by Meteor?

I'm new to both Meteor.js and MongoDB and after installing Meteor in the official way described I wonder how to connect to my MongoDB.
MongoDB was installed by Meteor during the installation and everything works fine but now I would like to have a look into it with another tool (like RazorSQL) to see what's in there.
But the standard connection parameters (localhost:27017) doesn't work, what can I do? Login? Password?
Update: February 2014 - Meteor 0.7.1 - The meteor port has been shifted to 3001 instead of 3002. So instead of adding two to the port meteor runs on, you add 1 instead.
MongoDB's database is installed in the meteor package containing your files in a hidden folder called .meteor. To access it from a remote tool simply add 2 to whatever your web server port is while meteor is running. It will be stored in the meteor database
e.g
http://localhost:3000 would have its mongodb server running at mongodb://localhost:3002/meteor there is no username/password on this instance if you ran it with meteor or meteor run
To get the Meteor Mongo url and port, first run your Meteor app using meteor run then run meteor mongo in a different terminal tab. You should see an output like this
[meteor-app] meteor mongo
MongoDB shell version: 2.6.7
connecting to: 127.0.0.1:3001/meteor
this means that your Meteor Mongo is running at 127.0.0.1:3001.
If you are running your Meteor app with meteor run then you neither need username/password nor authentication configuration just make sure that you set your default database name as meteor