Getting empty directory after running meteor mongo dump command

核能气质少年 提交于 2019-12-24 08:00:29

问题


I am trying to take dump of my mongo DB. As i am using meteor so i used the meteor command for taking dump i.e:-

mongodump -h 127.0.0.1 --port 3001 -d meteor

I also try to save the dump in a different location i.e:-

 mongodump -h 127.0.0.1 --port 3001 -d meteor  --out /home/parveen/Desktop/

But both time it will create a directory with name meteor and that directory is blank. I am just wondering to know why this is happening because i tried the same command few months before that time i got the dump as expected. But now its not working, i guess that might be because of new meteor update.

would appreciate if anybody give me any answer or guess why is this happening.

Thanks


回答1:


I get the answer why this is happening to me. Actually this issue is not related to meteor. This is because of mongod version that is not updated . Once i upgrade my mongod version to v3.2.0 and after that i hit the above given command for mongo dump . Its create a directory and not blank directory this time with theDB files.

For checking the monngod version simply type:-

mongod --version

For upgarde your version of Mongod just do following:-

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
udo apt-get update
sudo apt-get install -y mongodb-org=3.2.0 mongodb-org-server=3.2.0 mongodb-org-shell=3.2.0 mongodb-org-mongos=3.2.0 mongodb-org-tools=3.2.0

Hope it will help!

Thanks




回答2:


First, you need to spin up meteor.

Then if you run

meteor mongo

you will get an output something like this:

MongoDB shell version: 2.2.1
connecting to: 127.0.0.1:3001/meteor

Meteor DB host is at 127.0.0.1 with a port of 3001. Exit the mongo shell and use mongo dump from your terminal.

mongo dump -h 127.0.0.1 --port 3001 -d meteor

Dumps will be located under the dumps folder in the folder you executed the above command.

You can import your DB back to meteor with

mongorestore -h 127.0.0.1 --port 3001 -d meteor dump/meteor


来源:https://stackoverflow.com/questions/41438051/getting-empty-directory-after-running-meteor-mongo-dump-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!