meteor export mongo URL issue in my local - mongodb

I have my own system mongodb in my local machine(port : 27017)
And my meteor application is running same mahine fine when i am using the meteor mongo(port : 28017)
I have tried use the my system mongo using the floowing command
export MONGO_URL=mongodb://localhost:27017/ibm_project
Meteor Server started properly.
when i tried to access the URL, after couple of minutes, my system/PC is shuting down.
I am not sure what's wrong I am doing and can you please help me

Are you using windows command prompt? first check by typing below command
meteor mongo --url
above command will display your mongo url.If you want to run any other database in your local app, go to root folder and type below command
set MONGO_URL=mongodb://[username]:[password]#[host]:[port]/[databasename]
eg-set MONGO_URL=mongodb://root:abcde#ds049476.mlab.com:48474/mydb
above command is working on windows

Related

How to start mongodb service for windows

How can I run my mongo db service on windows 10
I have downloaded mongo db. tried coping data files in required directories . Whenever I try start mongodb service from task manager->services it shows windows could not start mongo db service.
Here's the official documentation about how to install and run MonogDB in window. Link
Secondly this question is also asked before you can get help from here too.
If you already have installed MongoDB in your window OS and make sure you have set the environment variable for MongoDB.
To start MongoDB server - type 'mongod' in command prompt.
Start MongoDB server
To start client - type 'mongo' in command prompt.
Start MongoDB client

Can't connect to local (running) mongo using 'meteor mongo'

I'm playing with meteor, Installed it on Ubuntu 14.10 & followed the todos tutorial. The Meteor run log:
$ meteor run
[[[[[ ~/bckd/homedir/learn/meteor/mycoolapp ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
When I try to connect to mongo via another terminal, I get:
$ meteor mongo
mongo: Meteor isn't running a local MongoDB server.
This command only works while Meteor is running your application locally. Start your
application first. (This error will also occur if you asked Meteor to use a different MongoDB
server with $MONGO_URL when you ran your application.)
If you're trying to connect to the database of an app you deployed with `meteor deploy`,
specify your site's name with this command.
Trying to work around this problem I looked at the mongo command, and soon enough I figured I can connect using:
$ mongo localhost:3001
So great, that's working and it seems that I am able to use that for the time being.
But... why is the official way: meteor mongo not working in my setup, and can I do anything to fix it?
Edit 5/6/2015
After creating another account on my ubuntu, logging in and creating a new app, I run it and managed to connect to the mongo instance as intended with the meteor mongo command (without sudo). I thought it could be a result of a difference in my environment variables so I compared the two (dumping both environments with the env command. There were some extra bash variables in my primary account so one by one I've unset them until I reached two identical environments (with the exceptions of home directory values, user names, auto-generated values for gnome session tokens and such). Despite those changes, the problem consists. Another wild guess of mine was that the ~/.meteor folder has gone evil on me. So, I've removed it and reinstalled meteor. That didn't fix it either. Whatever the problem is, it's pretty stubborn.
Try:
sudo meteor mongo
it worked for me on a Vagrant box :)
You need to be the same user as the user who started Meteor.
Also you need to connect from within the application directory.
Can you connect to the database with the native MongoDB client?
Try running sudo meteor mongo - maybe the Meteor/Node process is running as root.
Looks like it's your environment variable problem.
export MONGO_URL=''
meteor mongo
Did you create the meteor app initially :
meteor create
I was having same issue on Ubuntu and found that i missed the create part as I copied the code from windows machine.
In my case(Windows 10),I had set MONGO_URL='remote url'.
In this case when you type 'meteor mongo' meteor will try to connect to the local mongodb server,but we are pointing to remote mogodb.
To point to local mongodb:
1) befor starting the app type 'set MONOGO_URL=' command in terminal.
2) now start the meteor app
3) now open a new terminal and try 'meteor mongo'
This worked for me with the same problem.
I had two terminals open: one running with meteor command, the other terminal I tried meteor mongo and received the very same message as stated in the question.
mongo: Meteor isn't running a local MongoDB server.
This command only works while Meteor is running your application locally. Start
your application first with 'meteor' and then run this command in a new
terminal. This error will also occur if you asked Meteor to use a different
MongoDB server with $MONGO_URL when you ran your application.
If you're trying to connect to the database of an app you deployed with
'meteor deploy', specify your site's name as an argument to this command.
I tried the sudo command, which did not work as well.
Here is what worked for me.
Goto running meteor server terminal and ctrl-c (shut down server).
In meteor server terminal type: meteor mongo.
Note: In my case the command worked and the terminal entered into mongo.
Type exit to exit mongo.
Type meteor to spool back up meteor server.
Goto meteor mongo terminal and type: meteor mongo.
Note: For me, Meteor was running in the other terminal and meteor mongo command did open meteor mongo for me without error.
Perhaps the something in Meteor needs to reboot which does not occur without shutting down meteor server first?
check if there is a running mongo process, and kill it manually:
ps -aux | grep mongo
sudo kill [pid]
..then restart your meteor app.
--> I think this specific situation exists only when starting meteor on a custom port (not tested, but pretty obvious)

Meteor Mongo Error

I have just set up a meteor localhost app, and when trying to execute "meteor mongo" on the linux terminal, it shows this error:
mongo: Meteor isn't running a local MongoDB server.
This command only works while Meteor is running your application locally. Start
your application first. (This error will also occur if you asked Meteor to use
a different MongoDB server with $MONGO_URL when you ran your application.)
If you're trying to connect to the database of an app you deployed with
'meteor deploy', specify your site's name with this command.
What sould I do??
you need to have mongo server running to run meteor mongo and access it.
first open a terminal window and run your meteor app
meteor run
then open another window and access your mongo db
meteor mongo

Meteor Mongo error

I have just set up a meteor localhost app, and when trying to execute "meteor mongo" on the linux terminal, it shows this error:
mongo: Meteor isn't running a local MongoDB server.
This command only works while Meteor is running your application locally. Start
your application first. (This error will also occur if you asked Meteor to use
a different MongoDB server with $MONGO_URL when you ran your application.)
If you're trying to connect to the database of an app you deployed with
'meteor deploy', specify your site's name with this command.
What should I do??
Pretty much what it says:
Run meteor in one terminal.
Run meteor mongo in another terminal while the first one is still running.

Clone Mongo DB from Server to localhost in Meteor App [Environment Variable]

I have a Meteor App running on Modulus.net server. The App is using by many people, So I want to use the same Database Locally. I'm using Ubuntu 12.
I read other SO Posts, but none of them found useful.
I tried this code
$ export MONGO_URL=mongodb://user:pass#mongo.onmodulus.net/dbId?autoReconnect=true&connectTimeoutMS=60000
$ meteor run
It throws an Error
Unexpected mongo exit code 45. Restarting.
Can't start mongod
MongoDB cannot open or obtain a lock on a file
I have also tried sudo mrt as I have installed meteorite, now the app is running but the database not changed.
I'm a newbie to Terminal, Is there any way to do that?
Did you replace user:pass and dbId to your username, password, and dbID?
You can use mongo mongodb://user:pass#mongo.onmodulus.net/dbId to check whether you can access it or not first.
Update
Sorry for the misleading answer, mongo shell has a bug to log in while you enter the url like so. You can see here
Your code runs successfully on my computer. You can try to delete .meteor/local and then execute meteor run again.
If you want to use sudo to execute it, add the argument -E so that the environment variables will not be reset:
sudo -E meteor run