2016-01-10 45 views
6

我將mongo更新到版本3.2現在我收到此錯誤。之前我沒有收到錯誤。只有更新mongo後,我得到這個錯誤。我甚至試圖停止並再次啓動mongod服務,但仍然顯示相同的錯誤。啓動期間無法設置套接字。 dbexit:rc:mongodb中的48錯誤

rahul ~ $ mongod 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] MongoDB starting : pid=6630 port=27017 dbpath=/data/db 64-bit host=rahulcomp24-HP-ENVY-15-Notebook-PC 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] db version v3.2.0 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] allocator: tcmalloc 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] modules: none 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] build environment: 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten]  distmod: ubuntu1404 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten]  distarch: x86_64 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten]  target_arch: x86_64 
2016-01-10T23:39:51.696+0530 I CONTROL [initandlisten] options: {} 
2016-01-10T23:39:51.717+0530 E NETWORK [initandlisten] listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017 
2016-01-10T23:39:51.717+0530 E NETWORK [initandlisten] addr already in use 
2016-01-10T23:39:51.717+0530 E STORAGE [initandlisten] Failed to set up sockets during startup. 
2016-01-10T23:39:51.717+0530 I CONTROL [initandlisten] dbexit: rc: 48 

`

rahul ~ $ mongo 
MongoDB shell version: 3.2.0 
connecting to: test 
Server has startup warnings: 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] **  We suggest setting it to 'never' 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'. 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] **  We suggest setting it to 'never' 
2016-01-10T23:38:16.095+0530 I CONTROL [initandlisten] 

回答

2

所以mongod的輸出告訴

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

這意味着一些進程已在使用相同的SOCET。例如,如果我嘗試在已經運行的時候運行mongod,我會得到這個輸出。你確定這不是你的情況嗎?我想是這樣的,因爲蒙戈外殼似乎已成功連接...

+0

是我敢肯定,我不是運行任何其他mongod服務並行 –

5

查找端口27017運行的進程:

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

最後一列顯示的PID(3344)。找到該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 

對我來說,事實證明,VirtualBox的端口轉發是問題。

0

檢查,如果數據庫在運行,運行:

ps aux | grep mongo 

找到分貝(當然這裏是77071),並殺死它,運行:

kill -9 77071 
相關問題