Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2868  / 1 Year ago, tue, may 16, 2023, 8:51:17

While starting the Mongodb I got this error is socket connection:



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

More From » mongodb

 Answers
5

I met the same problem today, sudo service mongod restart or sudo service mongod stop does not really stop mongod process. I follow below steps solved the problem:




  1. Find mongod process id (414)



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

  2. Kill mongod



    sudo kill -9 414

  3. Start mongod



    sudo service mongod start


[#20619] Thursday, May 18, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hirtieve

Total Points: 207
Total Questions: 104
Total Answers: 114

Location: Cook Islands
Member since Thu, May 21, 2020
4 Years ago
;