tar -zxvf mongodb-linux-x86_64-rhel70-4.4.20.tgz
mv mongodb-linux-x86_64-rhel70-4.4.20 mongodb-4.4.20
1.2、创建数据存储文件和日志记录文件
cd mongodb-4.4.20
mkdir db
mkdir logs
1.3、创建配置文件
cd bin
vim mongodb.conf
# where storage data dbpath=/study/mongodb-4.4.20/db
# where storage loglogpath=/study/mongodb-4.4.20/logs/mongodb.log
port=27018# enable daemon processfork=true
# enable verificationauth=true
bind_ip=0.0.0.0
1.4、设置全局变量
vim /etc/profile
exportMONGODB_HOME=/study/mongodb-4.4.20/bin
exportPATH=$PATH:$MONGODB_HOME/bin
source /etc/profile