启动Mongodb时出错


0

启动Mongodb时,我收到此错误是套接字连接:

7 12:03:31.230 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 127.0.0.1:27017
Tue Apr  7 12:03:31.230 [initandlisten] ERROR:   addr already in use
Tue Apr  7 12:03:31.252 [websvr] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 127.0.0.1:28017
Tue Apr  7 12:03:31.253 [websvr] ERROR:   addr already in use

Answers:


0

我今天遇到了同样的问题,sudo service mongod restart还是sudo service mongod stop没有真正停止mongod进程。我按照以下步骤解决了问题:

  1. 查找mongod进程ID(414)

    $ sudo netstat -tlnp | grep 27017
    tcp        0      0 127.0.0.1:27017             0.0.0.0:*                   LISTEN      414/mongod
    
  2. mongod

    sudo kill -9 414
    
  3. 开始 mongod

    sudo service mongod start
    

0

这可能意味着mongodb的另一个实例已经在运行。您可以使用以下命令重新启动它:

sudo服务mongod重新启动

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.