Linux下MongoDB 4.X安装配置(图文详细)
一、资源准备
- 资源下载地址: https://www.mongodb.com/try/download
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210523154529365.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NDE4NzczMA==,size_16,color_FFFFFF,t_70)
二、安装配置
mkdir -p /opt/module /opt/soft
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210523154945284.png)
#解压命令
tar -vxf mongodb-linux-x86_64-rhel70-4.2.14.tgz -C /opt/module/
#切换目录
cd /opt/module/mongodb-linux-x86_64-rhel70-4.2.14/ && ll
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210523155305971.png)
#创建文件夹
mkdir -p repo/db repo/logs repo/conf
#创建日志文件
touch repo/logs/mongod.log
cd /opt/module/mongodb-linux-x86_64-rhel70-4.2.14/repo/conf
vim mongod.conf
dbpath = /opt/module/mongodb-linux-x86_64-rhel70-4.2.14/repo/db
logpath = /opt/module/mongodb-linux-x86_64-rhel70-4.2.14/repo/logs/mongod.log
bind_ip = 0.0.0.0
port = 27017
logappend=true
journal=