一两个月前我更新到12.04之后,我通过APT安装了MongoDB。从那时起,它一直运行良好。我没有对配置或任何内容进行任何更改-它开箱即用。
今天它没有开始,当我登录时,我的应用程序突然出现“无法连接到列表中的任何服务器”错误,我检查并且mongod
没有在运行。
ls -al /var/lib/mongodb
不显示*.lock
文件。
$ /etc/init.d/mongodb start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mongodb start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mongodb
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.89" (uid=1000 pid=4284 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")
然后我尝试 sudo mongod --repair
Mon Aug 13 12:16:48 [initandlisten] MongoDB starting : pid=4350 port=27017 dbpath=/data/db/ 64-bit host=computer-localhost
Mon Aug 13 12:16:48 [initandlisten] db version v2.0.4, pdfile version 4.5
Mon Aug 13 12:16:48 [initandlisten] git version: nogitversion
Mon Aug 13 12:16:48 [initandlisten] build info: Linux yellow 2.6.24-29-server #1 SMP Tue Oct 11 15:57:27 UTC 2011 x86_64 BOOST_LIB_VERSION=1_46_1
Mon Aug 13 12:16:48 [initandlisten] options: { repair: true }
Mon Aug 13 12:16:48 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating
Mon Aug 13 12:16:48 dbexit:
Mon Aug 13 12:16:48 [initandlisten] shutdown: going to close listening sockets...
Mon Aug 13 12:16:48 [initandlisten] shutdown: going to flush diaglog...
Mon Aug 13 12:16:48 [initandlisten] shutdown: going to close sockets...
Mon Aug 13 12:16:48 [initandlisten] shutdown: waiting for fs preallocator...
Mon Aug 13 12:16:48 [initandlisten] shutdown: lock for final commit...
Mon Aug 13 12:16:48 [initandlisten] shutdown: final commit...
Mon Aug 13 12:16:48 [initandlisten] shutdown: closing all files...
Mon Aug 13 12:16:48 [initandlisten] closeAllFiles() finished
Mon Aug 13 12:16:48 dbexit: really exiting now
知道有什么问题吗?
更新资料
因此,我尝试了sudo service mongodb start
一下,终于开始了(之前我尝试过几次)
mongodb start/running, process 4376