Importing collections breaks Meteor app deployed with mup - mongodb

My Meteor app is running on a Digital Ocean droplet.
Meteor: v1.5.3
Server: Ubuntu 14.04.5 x 64
It deploys fine with mup but when I use Studio 3T to import the collections from my old 1.2 app, I see continual error messages in the console like:
GET http://xxx.xx.xx.xx/sockjs/info?cb=u7lbhqd_js net::ERR_CONNECTION_REFUSED
GET requests for resources including images and routes are being refused. The app does run but very slowly and most images are not showing. It is not consistent; the same image will be missing, then appear when I return to the route.
I have imported the same JSON collections to my localhost version and they run perfectly.
I am connecting to the live database by forwarding the mongo instance to localhost with:
ssh -L 4321:localhost:27017 -i ~/.ssh/id_rsa root#xxx.xx.xx.xx
All the imported collections look fine on the live database. I can edit values in documents OK, it's only when I import an entire collection from a JSON file that it goes wrong. And I can't see why updating the collections would interfere with the GET requests.
Has anybody had a similar problem / any idea how to figure out what's going wrong?

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!

Heroku is not connecting with mongoose Atlas

I created a shopping site using node.js and launched it on Heroku, but I face one problem:
My heroku is not connecting with mongoose atlas
However, all configuration seems right, like uri variable.
What should I do: I did not get any error.
The official documentation is art "Using MongoDB Atlas on Heroku", written by Adrienne Tacke, so double-check your config (as in here), especially the db connection.
And, as described here, in order to do this in combination with Heroku dynos, add 0.0.0.0/0 (i.e. all addresses) to your MongoDB Atlas whitelist.
Finally, check your code (as seen here), using MongoClient.
You have a concrete example at "M2 - Heroku Deployment (with Mongo Atlas)" from Uros Cirkovic:
check your logs with heroku logs -n 200

How to perform something like meteor reset on deployed app?

I have an app deployed on digital ocean and am trying to perform a meteor reset to reset the DB etc. Where is meteor located when deployed via mup? I keep getting a command not recognized with meteor commands.
As far as I know you can't run meteor reset on deployed apps like that as it's already been built by MUP. The way you could mimic a meteor reset is to run the mongo shell on your digital ocean server:
mongo
You can check what the databases are by using:
show dbs
and then access the one meteor is running by doing:
use [db name]
and then manually drop the databases by using:
db.[collection name].drop()
http://docs.mongodb.org/manual/reference/method/db.collection.drop/
Meteor already has the user collection defined so you'd probably want to drop that collection too if you want a clean start

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

ideal vm setup for meteor with shared folder

situation
Hello, I run arch Linux for which there is no meteor package and have an Ubuntu server run within virtualbox for web development. There is a shared folder I mount through database. hich means I can code in to the active environment.
However, like many others, I have a problem with mongodb starting up, specifically the exit code 100.
tracing the problem:
I created the /data/DB directory
gave access rights to my user
ran mongod on its own with no problems
Still I have the issue though.
Question
Where is the configuration file for mongodb which is installed with meteor so I can move it and do I need to create rights for a 'mongodb' user?
Question
What would be the ideal virtual machine for running a meteor development environment in the above set up? Having to create the data directory in the first place tells me Ubuntu server isn't ideal. some extra documentation available to answer this second question appearing on the meteor website would be beautiful
MongoDB does not work correctly on virtualbox shared folders. By default, meteor creates a mongo database in your project's directory, however you can override this behavior with the MONGO_URL environment variable. If you set this variable, meteor will not try to start mongo and will instead connect directly to the mongo endpoint you specify. This allows you to setup mongo however you like (eg using the Ubuntu mongodb package), with data somewhere not in the shared folder.