So I started getting this annoying error on our staging server today. I searched all over and people’s only answer was “use a 64-bit server.” Ok, but my data is less than 200MB so don’t tell me my server can’t handle it.
To make a long story short, some of the Mongo data files in the datadir were owned by root, not the “mongodb” user. I chowned them back to “mongodb” and everything went back to normal. Why this happened, I don’t know, but at least there’s a fix ;-).
1 chown -R mongodb:mongodb /srv/mongo-datadir