Failed to set up sockets during startup. dbexit: rc: 48 error in mongodb

后端 未结 3 1383
青春惊慌失措
青春惊慌失措 2021-01-12 17:42

I updated mongo to version 3.2 now I am getting this error. Earlier I was not getting error. Only after updating mongo I am getting this error. I even tried to stop and star

相关标签:
3条回答
  • 2021-01-12 18:22

    Find the process running on port 27017:

    C:\Users\hughes> netstat -aon | findstr 27017
      TCP    0.0.0.0:27017          0.0.0.0:0              LISTENING       3344
    

    The last column shows the PID (3344). Find the process name for that PID:

    C:\Users\hughes> tasklist /fi "pid eq 3344"
    Image Name                     PID Session Name        Session#    Mem Usage
    ========================= ======== ================ =========== ============
    VirtualBox.exe                3344 Console                    1    101,908 K
    

    For me it turned out that VirtualBox's port forwarding was the issue.

    0 讨论(0)
  • 2021-01-12 18:34

    check if db in running, run:

    ps aux | grep mongo
    

    locate the db (ex. here is 77071) and kill it, run:

    kill -9 77071
    
    0 讨论(0)
  • 2021-01-12 18:39

    so the mongod output tells

    listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017"
    

    which means some process is already using the same socet. For instance, if I try to run mongod when its already running, I get exactly this output. Are you sure that this is not your case? I would guess so, as the mongo shell seems to connect successfully...

    0 讨论(0)
提交回复
热议问题