这篇文章给大家分享的是有关MongoDB副本集分片集群一分片config库主机断电导致该分片config库无法启动怎么办的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
由于机房意外断电,一分片config服务器断电导致该config库无法启动,相关报错如下:
关键报错信息:
2018-01-22T15:18:43.863+0800 I -[initandlisten] Detected data file in D:\mongodata\cfg created by the 'wiredTiger' storage
engine,so setting the active storage engine to 'wiredTiger'.
2018-01-22T15:18:43.865+0800 W- [initandlisten] Detected unclean shutdown -D:\mongodata\cfg\mongod.lock is not empty.
2018-01-22T15:18:43.866+0800 w STORAGE [initandlisten] Recovering data from the last clean checkpoint.
根据网上查到的处理方法:
1、关闭启动窗口
2、删除D:\mongodata\cfg\mongod.lock,
3、执行修复操作:D:\MongoDB\Server\3.2\bin\mongod --configsvr --replSet configReplSet --port 27001
--dbpath D:\mongodata\cfg --repair
2018-01-22T15:46:50.530+0800 I STORAGE [initandlisten] Repairing collection loc
al.system.replset
2018-01-22T15:46:50.531+0800 I STORAGE [initandlisten] Verify succeeded on uri
table:collection-4--3441646246172970043. Not salvaging.
2018-01-22T15:46:50.545+0800 I INDEX [initandlisten] build index on: local.sy
stem.replset properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.syste
m.replset" }
2018-01-22T15:46:50.545+0800 I INDEX [initandlisten] building index
using bulk method
2018-01-22T15:46:50.569+0800 I STORAGE [initandlisten] finished checking dbs
2018-01-22T15:46:50.569+0800 I CONTROL [initandlisten] now exiting
2018-01-22T15:46:50.569+0800 I NETWORK [initandlisten] shutdown: going to close
listening sockets...
2018-01-22T15:46:50.570+0800 I NETWORK [initandlisten] shutdown: going to flush
diaglog...
2018-01-22T15:46:50.570+0800 I NETWORK [initandlisten] shutdown: going to close
sockets...
2018-01-22T15:46:50.571+0800 I STORAGE [initandlisten] WiredTigerKVEngine shutt
ing down
2018-01-22T15:46:50.769+0800 I STORAGE [initandlisten] shutdown: removing fs lo
ck...
2018-01-22T15:46:50.770+0800 I CONTROL [initandlisten] dbexit: rc: 0
4、修复操作没有明显的报错,重新启动config库,问题依然存在,报错与上述提到的日志一致
由于是副本集分片集群,且该config库只是一个片的config库,该副本集分片集群一共有3台config库,于是决定删除该config库
的data目录D:\mongodata\cfg下的所有数据文件以从集群其他节点重新同步,该config库重新同步数据后恢复正常。
感谢各位的阅读!关于“MongoDB副本集分片集群一分片config库主机断电导致该分片config库无法启动怎么办”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!