MongoDB不会作为服务启动

时间:2014-10-27 02:57:04

标签: mongodb cpanel centos6

我最近在Centos Dedicated Server上安装了mongodb。当我尝试启动mongodb作为服务时,它会给我以下错误。

启动mongod:[FAILED]

当我刚刚执行mongod时,这就是我收到的内容。

2014-10-27T03:54:46.184+0100 [initandlisten] MongoDB starting : pid=2566 port=27017 dbpath=/data/db 64-bit host=sv.redswitches.com
2014-10-27T03:54:46.184+0100 [initandlisten] db version v2.6.5
2014-10-27T03:54:46.184+0100 [initandlisten] git version: e99d4fcb4279c0279796f237aa92fe3b64560bf6
2014-10-27T03:54:46.184+0100 [initandlisten] build info: Linux build8.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-10-27T03:54:46.184+0100 [initandlisten] allocator: tcmalloc
2014-10-27T03:54:46.184+0100 [initandlisten] options: {}
2014-10-27T03:54:46.195+0100 [initandlisten] journal dir=/data/db/journal
2014-10-27T03:54:46.196+0100 [initandlisten] recover : no journal files present, no recovery needed
2014-10-27T03:54:46.233+0100 [initandlisten] ERROR: listen(): bind() failed errno:98 Address already in use for socket: 0.0.0.0:27017
2014-10-27T03:54:46.233+0100 [initandlisten] ERROR:   addr already in use
2014-10-27T03:54:46.234+0100 [initandlisten] now exiting
2014-10-27T03:54:46.234+0100 [initandlisten] dbexit: 
2014-10-27T03:54:46.234+0100 [initandlisten] shutdown: going to close listening sockets...
2014-10-27T03:54:46.234+0100 [initandlisten] shutdown: going to flush diaglog...
2014-10-27T03:54:46.234+0100 [initandlisten] shutdown: going to close sockets...
2014-10-27T03:54:46.234+0100 [initandlisten] shutdown: waiting for fs preallocator...
2014-10-27T03:54:46.234+0100 [initandlisten] shutdown: lock for final commit...
2014-10-27T03:54:46.234+0100 [initandlisten] shutdown: final commit...
2014-10-27T03:54:46.244+0100 [initandlisten] shutdown: closing all files...
2014-10-27T03:54:46.244+0100 [initandlisten] closeAllFiles() finished
2014-10-27T03:54:46.244+0100 [initandlisten] journalCleanup...
2014-10-27T03:54:46.244+0100 [initandlisten] removeJournalFiles
2014-10-27T03:54:46.254+0100 [initandlisten] shutdown: removing fs lock...
2014-10-27T03:54:46.254+0100 [initandlisten] dbexit: really exiting now

我已经尝试过两次重新安装它。我也在这台服务器上安装了cPanel。

1 个答案:

答案 0 :(得分:1)

似乎已经在运行:

  

错误:listen():bind()失败错误:98地址已用于套接字:0.0.0.0:27017   2014-10-27T03:54:46.233 + 0100 [initandlisten]错误:addr已在使用中

另一个进程已经在使用那个很可能是另一个Mongo实例的端口。尝试运行

mongo
从命令行提示符

查看是否可以使用MongoDB shell实用程序进行连接。或者尝试

sudo netstat -tlnp | grep 27017

并查看哪个进程正在使用端口27017.在我的系统上它是mongo:

tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      25480/mongod