Using SSH I installed Mongodb in linux server by the following steps.
Download and extract latest Mongodb release to the /bin
folder in serer
I was having this error message after a clean install of mongodb.
What worked for me was removing the lock file and starting mongodb again.
Maybe see if that helps?
Source:
https://wiki.archlinux.org/index.php/MongoDB
First of all, make sure your dbpath exists.
mkdir -p ~/data/db
Then start mongod with:
mongod --dbpath ~/data/db
Finally:
mongo
EDIT: I saw some people vote this answer up. To make it clear, this solution is for you to start mongod with command line. Most of the time if you installed MongoDB package from source, you can just start the daemon with:
sudo systemctl start mongodb # Arch linux
sudo service mongod start # CentOS/Redhat
Configuration file can be found in:
vim /etc/mongod.conf
And if you want daemon to be auto started from boot,
sudo systemctl enable mongodb # Arch Linux
sudo chkconfig mongod on # CentOS/Redhat
I had similar issue after copying all mongodb files form one server to another in
/var/lib/mongodb/
directory. Solution in my case was to change permission group to all files and folders in
/var/lib/mongodb/
to
mongodb:nogroup