无法在AWS实例上启动mongodb

时间:2015-07-02 06:24:12

标签: node.js mongodb

我曾在mongodb数据库工作过。我在我的服务器和安装中安装了这个。为此工作。但目前我遇到了一个问题。我的mongodb数据库没有响应。当我发出这个命令时:mongo

MongoDB shell version: 2.6.10
connecting to: test
2015-07-02T06:22:11.363+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-07-02T06:22:11.364+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed

我已经删除了锁定文件,然后修复mongodb然后重启mongodb。但是无法解决我的问题。

这是我的mongodb.log文件:

2015-07-02T06:30:48.789+0000 [initandlisten] MongoDB starting : pid=5551 port=27017 dbpath=/var/lib/mongodb 64-bit host=ip-172-31-5-213
2015-07-02T06:30:48.789+0000 [initandlisten] db version v2.6.10
2015-07-02T06:30:48.789+0000 [initandlisten] git version: 5901dbfb49d16eaef6f2c2c50fba534d23ac7f6c
2015-07-02T06:30:48.789+0000 [initandlisten] build info: Linux build18.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
2015-07-02T06:30:48.789+0000 [initandlisten] allocator: tcmalloc
2015-07-02T06:30:48.789+0000 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2015-07-02T06:30:48.800+0000 [initandlisten] journal dir=/var/lib/mongodb/journal
2015-07-02T06:30:48.800+0000 [initandlisten] recover : no journal files present, no recovery needed
2015-07-02T06:30:48.800+0000 [initandlisten] 
2015-07-02T06:30:48.800+0000 [initandlisten] ERROR: Insufficient free space for journal files
2015-07-02T06:30:48.800+0000 [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
2015-07-02T06:30:48.800+0000 [initandlisten] 
2015-07-02T06:30:48.800+0000 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating
2015-07-02T06:30:48.800+0000 [initandlisten] dbexit: 
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: going to close listening sockets...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: going to flush diaglog...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: going to close sockets...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: waiting for fs preallocator...
2015-07-02T06:30:48.800+0000 [initandlisten] shutdown: lock for final commit...
2015-07-02T06:30:48.801+0000 [initandlisten] shutdown: final commit...
2015-07-02T06:30:48.801+0000 [initandlisten] shutdown: closing all files...
2015-07-02T06:30:48.801+0000 [initandlisten] closeAllFiles() finished
2015-07-02T06:30:48.801+0000 [initandlisten] journalCleanup...
2015-07-02T06:30:48.801+0000 [initandlisten] removeJournalFiles
2015-07-02T06:30:48.802+0000 [initandlisten] shutdown: removing fs lock...
2015-07-02T06:30:48.803+0000 [initandlisten] dbexit: really exiting now

2 个答案:

答案 0 :(得分:2)

根据您的mongodb.log文件:

ERROR: Insufficient free space for journal files
Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles

您没有足够的磁盘空间来启动MongoDB服务。 MongoDB无法为其Journal Files分配磁盘空间。

我可以为您的问题找到四种可能的解决方案:

答案 1 :(得分:0)

错误已经上升,通常是mongodb崩溃。 解决方案:

sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart
sudo service mongod stop
sudo service mongod start