MongoDB `smallfiles` setting on Ubuntu for development
I recently installed MongoDB on Ubuntu to do some development and noticed it didn’t start when I installed it via sudo aptitude install mongodb
. Checking the logs I discovered the problem:
[initandlisten] ERROR: Insufficient free space for journal files
[initandlisten] Please make at least 3379MB available in /var/lib/mongodb/journal or use --smallfiles
I have a tiny SSD on my computer and I really don’t need this using over 3GB just so I can do a little hacking.
OK so I’ll just set --smallfiles
. Under Ubuntu settings like arguments passed to a daemon when it starts are usually found in /etc/defaults
but I couldn’t see any such file for MongoDB.
It turned out you can also set this in the config file under /etc/mongodb.conf
so just add this line to the bottom of that file:
smallfiles = true