Confirm the installation of MongoDB version
To Https://www.mongodb.com/download-center?jmp=nav#community
Here my system is CentOS 6.5, which belongs to Red Hat 6 version
cd/usr/local/srcwget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64- Rhel62-3.4.4.tgztar zxvf mongodb-linux-x86_64-rhel62-3.4. 4 . TGZMV MongoDB-linux-x86_64-rhel62-3.4. 4. tgz. /mongodb
Adding MongoDB to an environment variable
Vim/etc/profile
Create a database directory
MongoDB data is stored in the DB directory in the database directory, but this directory is not created automatically during the installation process, so you need to create the data directory manually and create the DB directory in the data directory.
In the following example we create the data directory under the root directory (/).
Note:/data/db is the default startup database path for MongoDB (--dbpath).
Mkdir-p/data/db
Open Mongod Service in the background
Mongod &
Enter the MONGO client
Mongo
Linux Installation MongoDB