錯誤日誌:
2018-02-22T10:06:18.238+0800 I CONTROL [initandlisten] options: { config: "D:\MongoDB\mongo.config", net: { bindIp: "0.0.0.0", port: 37017 }, security: { authorization: "enabled" }, service: true, storage: { dbPath: "D:\MongoDB\data\db" }, systemLog: { destination: "file", path: "D:\MongoDB\data\log\mongo.log" } }
2018-02-22T10:06:18.239+0800 I - [initandlisten] Detected data files in D:\MongoDB\data\db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-02-22T10:06:18.239+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=18G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2018-02-22T10:06:19.577+0800 E STORAGE [initandlisten] WiredTiger (0) [1519265179:577663][44612:2000958368], file:collection-4-3828813183626914028.wt, WT_SESSION.open_cursor: D:\MongoDB\data\db\collection-4-3828813183626914028.wt: handle-truncate: SetEndOfFile: 由於文件系統限制,因此請求的操作無法完成
修復MongoDB
先刪除D:\MongoDB\data\mongod.lock
在執行修復命令必須要指定dbpath
D:\MongoDB\Mongo\bin>mongod.exe --dbpath "d:\MongoDB\data\db" --repair