mongo 有时在操作时候无法启动
1 **************
old lock file: /usr/local/www/mongodb/mongod.lock. probably means unclean shutdown
recommend removing file and running –repair
see: http://dochub.mongodb.org/core/repair for more information
*************
看到 old lock 就知道是因为mongo 生产文件锁 ,此时必须删除锁文件 才能正常启动
使用命令:rm -f /usr/local/www/mongodb/mongod.lock 删除锁文件在进行启动,lock文件存储于 mongo 的数据所在目录下
2 Sat Jan 29 12:35:35 MongoDB starting : pid=8298 port=27017 dbpath=/var/lib/mongodb 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations
解决办法:
- Manually remove the lockfile:
sudo rm /var/lib/mongodb/mongod.lock
- Run the repair script:
sudo -u mongodb /usr/bin/mongod -f /etc/mongodb.conf --repair
.
参考资料:
http://liuskysun.blog.163.com/blog/static/998129782011043221867/ (mongo 启动失败 2点)
http://blog.nroed.com/category/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%BA%94%E7%94%A8/%E9%85%8D%E7%BD%AE%E5%AE%89%E8%A3%85/ ( nroed 的 PHPer 日志 )