报错背景
- 1、虚拟机磁盘容量不足
- 2、添加硬盘并重新分区,挂载后将mongdbdata的数据mv到新挂载的分区上,重新做软链。
- 3、启动报错
启动报错信息:
[root@192.168.201.228 config]#/data1/xinsrv/mongodb/bin/mongod -f /data1/xinsrv/mongodb/config/mongo.cnf
about to fork child process, waiting until server is ready for connections.
forked process: 2080
ERROR: child process failed, exited with error number 100
日志详细报错信息:
2017-09-01T17:45:05.525+0800 [initandlisten] recover /data/mongodbdata/journal/j._30
2017-09-01T17:45:05.764+0800 [initandlisten] recover final skipped journal section had sequence number 13631087959
2017-09-01T17:45:05.764+0800 [initandlisten] recover applying initial journal section with sequence number 13632874969
2017-09-01T17:45:05.778+0800 [initandlisten] dbexception during recovery: 15923 couldn't get file length when opening mapping /data/mongodbdata/checklist.4 boost::filesystem::file_size: No such file or directory: "/data/mongodbdata/checklist.4"
2017-09-01T17:45:05.778+0800 [initandlisten] exception in initAndListen: 15923 couldn't get file length when opening mapping /data/mongodbdata/checklist.4 boost::filesystem::file_size: No such file or directory: "/data/mongodbdata/checklist.4", terminating
2017-09-01T17:45:05.778+0800 [initandlisten] dbexit:
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: going to close listening sockets...
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: going to flush diaglog...
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: going to close sockets...
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: waiting for fs preallocator...
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: lock for final commit...
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: final commit...
2017-09-01T17:45:05.778+0800 [initandlisten] shutdown: closing all files...
2017-09-01T17:45:05.778+0800 [initandlisten] closeAllFiles() finished
解决方法:
1、删除了/data/mongodbdata/mongo.lock 不好使
2、删除了/data/mongodbdata/journal/j._30 启动正常 注意:数据会丢失