Mongodb Installation
Install MongoDB Community Edition
Download the binary files for the desired release of MongoDB.
curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.9.tgz
Extract the files from the downloaded archive.
tar -zxvf mongodb-linux-x86_64-3.2.9.tgz
Copy the extracted archive to the target directory
mkdir -p ~/mongodb-3.2.9mv mongodb-linux-x86_64-3.2.9 ~/mongodb-3.2.9
Ensure the location of the binaries is in the PATH variable.
export PATH=<mongodb-install-directory>/bin:$PATH
Run MongoDB Community Edition
Create the data directory
Before you start MongoDB for the first time, create the directory to which the mongod process will write data.
By default, the mongod process uses the /data/db directory.
If you create a directory other than this one, you must specify that directory in the dbpath option when starting the mongod process later in this procedure.
mkdir -p /data/mongodb