mongodump 失败且导致mongo服务挂掉

Posted zhzhang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mongodump 失败且导致mongo服务挂掉相关的知识,希望对你有一定的参考价值。

问题阐述:

mongodb版本3.2.7(yum安装)

需要mongodump出一个collection 如下

mongodump --collection abc --db db

 abc 为接近2亿条,单条大概200B

每次执行mongodum命令,进度到52.5%就会报错如下,并且mongo服务挂掉,必须重启

2017-05-02T17:08:51.663+0800    [############............]  db.abc  91363661/177602822  (51.4%)
2017-05-02T17:08:54.663+0800    [############............]  db.abc  91744632/177602822  (51.7%)
2017-05-02T17:08:57.663+0800    [############............]  db.abc  92279192/177602822  (52.0%)
2017-05-02T17:09:00.663+0800    [############............]  db.abc  92629211/177602822  (52.2%)
2017-05-02T17:09:03.663+0800    [############............]  db.abc  93112828/177602822  (52.4%)
2017-05-02T17:09:05.619+0800    [############............]  db.abc  93288043/177602822  (52.5%)
2017-05-02T17:09:09.823+0800    Failed: error reading collection: EOF
You have mail in /var/spool/mail/admin

[[email protected]-1.dev.abc-inc.com /abc_log_nas]
$ps aux | grep mongo
admin    30931  0.0  0.0 103244   860 pts/2    S+   17:14   0:00 grep mongo
You have mail in /var/spool/mail/admin

[[email protected]-1.dev.abc-inc.com /home/admin/bin]
#/etc/init.d/mongod status
mongod dead but subsys locked

[[email protected]-1.dev.abc-inc.com /home/admin/bin]
#/etc/init.d/mongod restart
Stopping mongod:                                           [  OK  ]
Starting mongod:                                           [  OK  ]

[[email protected]-1.dev.abc-inc.com /home/admin/bin]
#tail -n 10 /var/spool/mail/admin 
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=admin>
X-Cron-Env: <USER=admin>
Message-Id: <20160601115558[email protected]1.dev.rokid-inc.com>
Date: Mon, 11 Apr 2016 05:16:11 +0800 (CST)

ssh: Could not resolve hostname syslog-1: Temporary failure in name resolution
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6]

rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6]

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(600) [receiver=3.0.6]

目前还没找到解决的方法。。。。。。同时也求助各位大神。。。。。。

以上是关于mongodump 失败且导致mongo服务挂掉的主要内容,如果未能解决你的问题,请参考以下文章

Mongodb分片配置服务器不同步导致mongos进程启动失败

Mongo的备份和恢复(mongodump 和mongorestore )

用mongodump以及mongorestore来完成mongo的迁移任务

docker mongo backup 不用找啦,就在这里。

k8s中mongo容器数据迁移之内存小坑

使用Mongo dump 将数据导入到hive