问题描述
我正在尝试转储我的mongo数据库.由于我正在使用流星,所以我使用了meteor命令进行转储,即:-
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/
但是这两次都会创建一个名为meteor的目录,并且该目录为空.我只是想知道为什么会这样,因为在那之前的几个月我尝试了相同的命令,所以我得到了预期的转储.但是现在它不起作用了,我想可能是因为新的流星更新.
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.
谢谢
推荐答案
我得到了为什么发生这种情况的答案.实际上,此问题与流星无关. 这是由于未更新的mongod版本造成的.在将mongod版本升级到v3.2.0 之后,我按了上面给定的mongo dump命令.这次使用DB文件创建一个目录,而不是空白目录.
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.
要检查monngod版本,只需键入:-
For checking the monngod version simply type:-
要升级您的Mongod版本,请执行以下操作:-
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
希望这会有所帮助!
谢谢
这篇关于运行流星mongo dump命令后获取空目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!