Alternatively you can run mongod with --smallfiles parameter like:\nmongod --smallfiles<\/pre>\nOn my machine the problem was different. It was expecting a directory \/var\/lib\/mongod with proper permissions, which was not there. The solution is simple:<\/p>\n
sudo mkdir \/var\/lib\/mongod\nsudo chown -R mongod \/var\/lib\/mongod<\/pre>\nHowever how did I find out about the problem(s) in the first place. Again the solution is very simple. I looked in the log file:<\/p>\n
vi \/var\/log\/mongodb\/mongodb.log<\/pre>\nAlways start with the log file.
\nFinally you can verify that your system is running properly with:<\/p>\n
sudo service mongod status<\/pre>\nAfter fixing it gave:<\/p>\n
mongod (pid 26194) is running...<\/pre>\nNow that’s solved, let’s get back to mongodb coding..<\/p>\n","protected":false},"excerpt":{"rendered":"
Is your MongoDB properly running? A simple way to check it would be with: service mongod status On my CentOS 5.x it gave: mongod dead but subsys locked There are two possible causes I could find. First is related to disk space. If you do not have enough space for dbpath (database directory) then you […]<\/p>\n","protected":false},"author":1,"featured_media":12391,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,12],"tags":[72],"_links":{"self":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/12390"}],"collection":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/comments?post=12390"}],"version-history":[{"count":0,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/12390\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/media?parent=12390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/categories?post=12390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/tags?post=12390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}