由于以下错误,Mongod 服务器无法启动

San*_*ode 2 permissions mongodb

   sanket@sanket:~$ sudo mongod
sudo: unable to resolve host sanket
[sudo] password for sanket: 
mongod --help for help and startup options
Sun Oct  5 09:58:48.970 [initandlisten] MongoDB starting : pid=2548 port=27017 dbpath=/data/db/ 64-bit host=sanket
Sun Oct  5 09:58:48.970 [initandlisten] db version v2.4.9
Sun Oct  5 09:58:48.970 [initandlisten] git version: nogitversion
Sun Oct  5 09:58:48.970 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54
Sun Oct  5 09:58:48.970 [initandlisten] allocator: tcmalloc
Sun Oct  5 09:58:48.970 [initandlisten] options: {}
Sun Oct  5 09:58:49.101 [initandlisten] journal dir=/data/db/journal
Sun Oct  5 09:58:49.102 [initandlisten] recover : no journal files present, no recovery needed
Sun Oct  5 09:58:49.237 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
Sun Oct  5 09:58:49.237 [websvr] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:28017
Sun Oct  5 09:58:49.237 [initandlisten] ERROR:   addr already in use
Sun Oct  5 09:58:49.237 [websvr] ERROR:   addr already in use
Sun Oct  5 09:58:49.237 [initandlisten] now exiting
Sun Oct  5 09:58:49.237 dbexit: 
Sun Oct  5 09:58:49.237 [initandlisten] shutdown: going to close listening sockets...
Sun Oct  5 09:58:49.237 [initandlisten] shutdown: going to flush diaglog...
Sun Oct  5 09:58:49.237 [initandlisten] shutdown: going to close sockets...
Sun Oct  5 09:58:49.237 [initandlisten] shutdown: waiting for fs preallocator...
Sun Oct  5 09:58:49.237 [initandlisten] shutdown: lock for final commit...
Sun Oct  5 09:58:49.237 [initandlisten] shutdown: final commit...
Sun Oct  5 09:58:49.328 [initandlisten] shutdown: closing all files...
Sun Oct  5 09:58:49.328 [initandlisten] closeAllFiles() finished
Sun Oct  5 09:58:49.328 [initandlisten] journalCleanup...
Sun Oct  5 09:58:49.328 [initandlisten] removeJournalFiles
Sun Oct  5 09:58:49.390 [initandlisten] shutdown: removing fs lock...
Sun Oct  5 09:58:49.390 dbexit: really exiting now
sanket@sanket:~$ 
Run Code Online (Sandbox Code Playgroud)

Guj*_*ana 6

尝试这个 :

ps wuax | grep mongo

你应该看到像这样的东西

Savio           10592   0.5 0.4 2719784 35624   ?? S     7:34pm   0:09.98 mongod 
Savio           10911   0.0 0.0 2423368   184 s000 R+   8:24pm   0:00.00 grep mongo
Run Code Online (Sandbox Code Playgroud)

或找到单词 mongod。

进而

sudo kill 10592

之后再次启动mongod。对我来说它的工作,对于错误地址已经使用。