问题描述
我正在尝试从 远程 ssh
mongodump --host mongodb1.example.net --port 27017 --username user --password pass --out /opt/backup/mongodump-2013-10-24
但是,我得到的只是每个集合的空白文件夹.
However, all I am getting is blank folders for each collections.
我做错了什么?
信息(如果重要):源 Mongodb 在 Windows Server 上SSH 是远程 Ubuntu 机器
Info (if it matters):Source Mongodb is on Windows ServerAnd SSH is of a remote Ubuntu Machine
这是终端输出:
connected to: ip.ip.ip.ip:27017
Thu Feb 18 00:46:01.757 all dbs
Thu Feb 18 00:46:01.809 DATABASE: admin to /opt/backup/mongodump-2013-10-24/admin
Thu Feb 18 00:46:01.903 DATABASE: anthony_data to /opt/backup/mongodump-2013-10-24/anthony_data
Thu Feb 18 00:46:02.004 DATABASE: temp_data to /opt/backup/mongodump-2013-10-24/temp_data
Thu Feb 18 00:46:02.104 DATABASE: zoomy to /opt/backup/mongodump-2013-10-24/zoomy
因此它为所有集合创建空文件夹.但是里面没有bson
So it creates empty folder for all collections. But there is no bson in it
推荐答案
检查您的 mongodump 副本和数据库本身的版本是否相同.
Check that your copy of mongodump and the database itself is the same version.
当我尝试使用 2.4.1 mongodump 客户端对 mongo 3.2.4 服务器进行转储时,我遇到了完全相同的问题(没有终端输出或日志).删除旧客户端并安装新客户端立即解决了问题.
I had the exact same problem (complete with no terminal output or logs) when I tried to do a dump of a mongo 3.2.4 server with a 2.4.1 mongodump client. Removing the older client and installing the newer one resolved it immediately.
这篇关于Mongodump 获取空白文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!