服务器当机重启后, mongoDB无法正常启动案例之解决方式


  • Lv 1

    以下为错误讯息:

    ==========================================================================

    $ mongo

    Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:145

    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=" interface=vboxnet0" 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: 8190 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

    ==========================================================================

    解决方式:

    sudo -u mongodb mongod --repair --dbpath /var/lib/mongodb/
    sudo service mongod start

  • 註冊用戶

    學習了~感謝分享~


登录后回复
 

与 萌阔论坛 的连接断开,我们正在尝试重连,请耐心等待