I followed the official guide at http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
After use
$sudo service mongod start
I went to check if MongoDB was successful by looking at this log:
/var/log/mongodb/mongod.log
This is the problem I found:
2014-11-11T12:54:05.808-0500 [initandlisten] ERROR: Insufficient free space for journal files 2014-11-11T12:54:05.808-0500 [initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles 2014-11-11T12:54:05.808-0500 [initandlisten] 2014-11-11T12:54:05.808-0500 [initandlisten] exception in initAndListen: 15926 Insufficient free space for journals, terminating 2014-11-11T12:54:05.808-0500 [initandlisten] dbexit: 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: going to close listening sockets... 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: going to flush diaglog... 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: going to close sockets... 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: waiting for fs preallocator... 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: lock for final commit... 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: final commit... 2014-11-11T12:54:05.808-0500 [initandlisten] shutdown: closing all files... 2014-11-11T12:54:05.808-0500 [initandlisten] closeAllFiles() finished 2014-11-11T12:54:05.808-0500 [initandlisten] journalCleanup... 2014-11-11T12:54:05.808-0500 [initandlisten] removeJournalFiles 2014-11-11T12:54:05.814-0500 [initandlisten] shutdown: removing fs lock... 2014-11-11T12:54:05.814-0500 [initandlisten] dbexit: really exiting now
Decision:
At the end of the /etc/mongod.conf file, I added this line:
smallfiles = true
After that, I restarted the mongod service:
$sudo service mongod restart
Then, when I went to view the magazine, I realized that everything was perfect and the problem was fixed:
2014-11-11T22:32:20.544-0500 ***** SERVER RESTARTED ***** 2014-11-11T22:32:20.552-0500 [initandlisten] MongoDB starting : pid=5200 port=27017 dbpath=/var/lib/mongodb 64-bit host=jaimemontoya-VirtualBox 2014-11-11T22:32:20.552-0500 [initandlisten] db version v2.6.5 2014-11-11T22:32:20.552-0500 [initandlisten] git version: e99d4fcb4279c0279796f237aa92fe3b64560bf6 2014-11-11T22:32:20.552-0500 [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-11-11T22:32:20.552-0500 [initandlisten] allocator: tcmalloc 2014-11-11T22:32:20.552-0500 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/var/lib/mongodb", smallFiles: true }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } } 2014-11-11T22:32:20.564-0500 [initandlisten] journal dir=/var/lib/mongodb/journal 2014-11-11T22:32:20.564-0500 [initandlisten] recover : no journal files present, no recovery needed 2014-11-11T22:32:20.738-0500 [initandlisten] waiting for connections on port 27017 2014-11-11T22:33:20.748-0500 [clientcursormon] mem (MB) res:36 virt:245 2014-11-11T22:33:20.748-0500 [clientcursormon] mapped (incl journal view):64 2014-11-11T22:33:20.748-0500 [clientcursormon] connections:0
Jaime Montoya Nov 12 '14 at 3:47 a.m. 2014-11-12 03:47 a.m.
source share