kill -9 8545
使用了这个命令关闭mongodb,使得重启的时候,重启不了! 需要把mongodb.lock 这个文件删除掉才能启动! 而且还会偶尔发生数据丢失的事情,需要repair(./mongod --repair)一下才行! 看了一下文档,关闭mongodb有两种:
使用客户端mondo
$ ./mongo > db.shutdownServer()
直接 kill -2 PID," or kill -15 PID
kill -9 的官方解析: Sending a KILL signal kill -9 will probably cause damage as mongod will not be able to cleanly exit. (In such a scenario, run the repairDatabase command.)