Reputation: 2923
I have worked on mongodb database. I have installed this in my server & worked on this. But currently I am facing a problem. My mongodb database is not responding. When I am giving this command : 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
I have already delete the lock file, then repair mongodb then restart mongodb. But cant solve my problem.
Here is my mongodb.log
file:
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
Upvotes: 0
Views: 2855
Reputation: 735
Error has been rised typically it was mongodb crash. Solution :
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart
sudo service mongod stop
sudo service mongod start
Upvotes: 0
Reputation: 51450
According to your mongodb.log
file:
ERROR: Insufficient free space for journal files
Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
You don't have enough disk space to start your MongoDB service. MongoDB fails to allocate disk space for its Journal Files.
I can see four possible solutions for your problem:
--smallfiles
key or by setting storage.mmapv1.smallFiles to true
.--nojournal
key or by setting storage.journal.enabled to false
(not recommended).3.x
and change your storage engine to WiredTiger, it'll reduce your overall database size and free some disk space. But you'll need additional disk space for data migration.Upvotes: 2