我的Ubuntu计算机崩溃了,当我重新启动它时,MongoDB无法正常工作。我想下面的命令,并得到了以下的输出:服务器崩溃后MongoDB无法启动
$ mongo
Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed
$ service mongodb status
mongodb stop/waiting
$ service mongodb restart
stop: Unknown instance:
start: Rejected send message, 1 matched rules; type="method_call",
sender=":1.57" (uid=1000 pid=2227 comm="start mongodb ")
interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)"
requested_reply="0"
destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
$ tail /var/log/mongodb/mongodb.log
[initandlisten] exception in initAndListen: 12596 old lock file, terminating
dbexit:
[initandlisten] shutdown: going to close listening sockets...
[initandlisten] shutdown: going to flush diaglog...
[initandlisten] shutdown: going to close sockets...
[initandlisten] shutdown: waiting for fs preallocator...
[initandlisten] shutdown: closing all files...
[initandlisten] closeAllFiles() finished
dbexit: really exiting now
(输出格式化匹配的网站布局。)
发生了什么?我该如何解决它?
对于Windows,请参阅http://stackoverflow.com/questions/11877930/mongodb-cant-start-on-windows – TrueWill
亲爱的@HosamAly, 我该如何解决它,因为服务器通常会崩溃。所以我必须在服务器崩溃后手动进行操作?这是非常糟糕的,因为其他数据库(mysql,postgresql,..)总是在服务器崩溃后成功启动 –
@JohnNguyen你可以自动化它,但我会建议反对,因为你不会有机会看到损害这可能是由“修复”过程造成的。 –