簡體   English   中英

運行“ mongod”時出錯

[英]Error when run “mongod”

我正在使用node.js和express.js制作應用程序。 當我運行mongo works時,當我嘗試運行mongod時出現此錯誤,並且沒有輸入localhost:28017

蒙哥

MongoDB shell version: 3.0.12
connecting to: test
Server has startup warnings: 
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] 
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] 
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-07-08T07:19:25.309-0300 I CONTROL  [initandlisten] 

運行時

蒙哥

> 2016-07-08T10:29:01.459-0300 I CONTROL  [initandlisten] MongoDB
> starting : pid=9761 port=27017 dbpath=/data/db 64-bit host=lucaspc
> 2016-07-08T10:29:01.459-0300 I CONTROL  [initandlisten] db version
> v3.0.12 2016-07-08T10:29:01.459-0300 I CONTROL  [initandlisten] git
> version: 33934938e0e95d534cebbaff656cde916b9c3573
> 2016-07-08T10:29:01.459-0300 I CONTROL  [initandlisten] build info:
> Linux ip-10-229-66-2 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10
> 19:11:08 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
> 2016-07-08T10:29:01.459-0300 I CONTROL  [initandlisten] allocator:
> tcmalloc 2016-07-08T10:29:01.459-0300 I CONTROL  [initandlisten]
> options: {} 2016-07-08T10:29:01.500-0300 E NETWORK  [initandlisten]
> listen(): bind() failed errno:98 Address already in use for socket:
> 0.0.0.0:27017 2016-07-08T10:29:01.500-0300 E NETWORK  [initandlisten]   addr already in use 2016-07-08T10:29:01.532-0300 I JOURNAL 
> [initandlisten] journal dir=/data/db/journal
> 2016-07-08T10:29:01.532-0300 I JOURNAL  [initandlisten] recover : no
> journal files present, no recovery needed 2016-07-08T10:29:01.624-0300
> I JOURNAL  [durability] Durability thread started
> 2016-07-08T10:29:01.624-0300 I JOURNAL  [journal writer] Journal
> writer thread started 2016-07-08T10:29:01.682-0300 I CONTROL 
> [initandlisten]  2016-07-08T10:29:01.682-0300 I CONTROL 
> [initandlisten] ** WARNING:
> /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
> 2016-07-08T10:29:01.682-0300 I CONTROL  [initandlisten] **        We
> suggest setting it to 'never' 2016-07-08T10:29:01.682-0300 I CONTROL 
> [initandlisten]  2016-07-08T10:29:01.682-0300 I CONTROL 
> [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag
> is 'always'. 2016-07-08T10:29:01.682-0300 I CONTROL  [initandlisten]
> **        We suggest setting it to 'never' 2016-07-08T10:29:01.682-0300 I CONTROL  [initandlisten] 
> 2016-07-08T10:29:01.688-0300 I CONTROL  [initandlisten] now exiting
> 2016-07-08T10:29:01.688-0300 I NETWORK  [initandlisten] shutdown:
> going to close listening sockets... 2016-07-08T10:29:01.688-0300 I
> NETWORK  [initandlisten] shutdown: going to flush diaglog...
> 2016-07-08T10:29:01.688-0300 I NETWORK  [initandlisten] shutdown:
> going to close sockets... 2016-07-08T10:29:01.689-0300 I STORAGE 
> [initandlisten] shutdown: waiting for fs preallocator...
> 2016-07-08T10:29:01.689-0300 I STORAGE  [initandlisten] shutdown:
> final commit... 2016-07-08T10:29:01.732-0300 I JOURNAL 
> [initandlisten] journalCleanup... 2016-07-08T10:29:01.732-0300 I
> JOURNAL  [initandlisten] removeJournalFiles
> 2016-07-08T10:29:01.794-0300 I JOURNAL  [initandlisten] Terminating
> durability thread ... 2016-07-08T10:29:01.894-0300 I JOURNAL  [journal
> writer] Journal writer thread stopped 2016-07-08T10:29:01.894-0300 I
> JOURNAL  [durability] Durability thread stopped
> 2016-07-08T10:29:01.894-0300 I STORAGE  [initandlisten] shutdown:
> closing all files... 2016-07-08T10:29:01.895-0300 I STORAGE 
> [initandlisten] closeAllFiles() finished 2016-07-08T10:29:01.895-0300
> I STORAGE  [initandlisten] shutdown: removing fs lock...
> 2016-07-08T10:29:01.896-0300 I CONTROL  [initandlisten] dbexit:  rc:
> 48

而不連接localhost:28017

您已經在端口28017上實例化了一個mongo實例。該錯誤表明該端口已在使用中。 您需要殺死任何正在運行的實例。

嘗試ps -ef | grep mongo查找mongo實例的pid。

默認端口mongo運行在27017。您也可以使用

lsof -n -i TCP | grep 27017獲取運行mongo的端口列表。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM