MongoDB 副本集分片叢集一分片config庫主機斷電導致該分片config庫無法啟動

清風艾艾發表於2018-01-22
    2018年,1月22日,由於機房意外斷電,一分片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庫重新同步資料後恢復正常。



 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29357786/viewspace-2150401/,如需轉載,請註明出處,否則將追究法律責任。

相關文章