web-dev-qa-db-fra.com

Impossible de démarrer MongoDB. ERREUR: addr déjà utilisé

J'ai essayé d'exécuter MongoDB sur un serveur local avec mongod command et son exécution a échoué. L'erreur:

mongod --help for help and startup options
Sat Jan 31 13:07:16.392 [initandlisten] MongoDB starting : pid=5127 port=27017 dbpath=/data/db/ 64-bit Host=leandrotk
Sat Jan 31 13:07:16.392 [initandlisten] db version v2.4.9
Sat Jan 31 13:07:16.392 [initandlisten] git version: nogitversion
Sat Jan 31 13:07:16.392 [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
Sat Jan 31 13:07:16.392 [initandlisten] allocator: tcmalloc
Sat Jan 31 13:07:16.392 [initandlisten] options: {}
Sat Jan 31 13:07:16.435 [initandlisten] journal dir=/data/db/journal
Sat Jan 31 13:07:16.435 [initandlisten] recover : no journal files present, no recovery needed
Sat Jan 31 13:07:16.513 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
Sat Jan 31 13:07:16.514 [initandlisten] ERROR:   addr already in use
Sat Jan 31 13:07:16.514 [websvr] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:28017
Sat Jan 31 13:07:16.514 [initandlisten] now exiting
Sat Jan 31 13:07:16.514 [websvr] ERROR:   addr already in use
Sat Jan 31 13:07:16.514 dbexit: 
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: going to close listening sockets...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: going to flush diaglog...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: going to close sockets...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: waiting for fs preallocator...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: lock for final commit...
Sat Jan 31 13:07:16.514 [initandlisten] shutdown: final commit...
Sat Jan 31 13:07:16.599 [initandlisten] shutdown: closing all files...
Sat Jan 31 13:07:16.599 [initandlisten] closeAllFiles() finished
Sat Jan 31 13:07:16.599 [initandlisten] journalCleanup...
Sat Jan 31 13:07:16.599 [initandlisten] removeJournalFiles
Sat Jan 31 13:07:16.668 [initandlisten] shutdown: removing fs lock...
Sat Jan 31 13:07:16.668 dbexit: really exiting now
10
leandrotk

vous avez déjà un processus en cours d'exécution

killall mongod 

devrait tuer l'autre processus, si vous avez un autre type de processus lié à ce port, vous pouvez le trouver avec netstat | grep 27017

40
Grady Player

Essaye ça:

Sudo service mongodb stop

Sudo mongod
5
Saroj Rai

une version est:

Sudo service mongod stop

mongod: mongo damon
0
Bill