1. Download MongoDB Package (RHEL 7 Linux 64-bit x64)
[Email protected]/]# wget-p/usr/local/src/https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.0.1.tgz
2. Unpack the package:
[Email protected]/]# TAR-XZVF mongodb-linux-x86_64-rhel70-4.0.1.tgz-c/usr/local/src/[[email protected]/]# mv/usr/l Ocal/src/mongodb-linux-x86_64-rhel70-4.0.1/usr/local/mongodb
3. Create the directory required for the program to run:
[Email protected]/]# Mkdir/usr/local/mongodb/etc/usr/local/mongodb/data/usr/local/mongodb/log
4. Create a MongoDB configuration file:
[Email protected]/]# Vim/usr/local/mongodb/etc/mongod.confdbpath =/usr/local/mongodb/data/logpath =/usr/local/ Mongodb/log/mongodb.logpidfilepath =/usr/local/mongodb/log/mongodb.pidbind_ip = 127.0.0.1port = 27017fork = True
5. Start the MongoDB program:
[Email protected]/]#/usr/local/mongodb/bin/mongod-f/usr/local/mongodb/etc/mongod.conf
6. MongoDB added to the system environment variable:
[Email protected]/]# sed-i ' $a export mongodb_home=/usr/local/mongodb\nexport path= $MONGODB _home/bin: $PATH '/etc/ Profile
[Email protected]/]# Source/etc/profile
7. MongoDB Client Login:
[[email protected]/]# mongomongodb Shell version v4.0.1connecting to:mongodb://127.0.0.1:27017mongodb server Version:4 .0.1
[The END]
MongoDB Configuration Concise Documentation