安装及操作命令
cd /opt
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.0.tgz
tar -zxvf mongodb-linux-x86_64-3.4.0.tgz
#修改文件夹名字为mongodb-3.4.0
mv mongodb-linux-x86_64-3.4.0 mongodb-3.4.0
# 在/opt/mongodb-3.4.0/conf目录下创建mongo.conf
# 内容如下------------------
# 存储引擎相关参数
storage:
dbPath: /opt/mongodb-3.4.0/data/mongodb
journal:
enabled: true
mmapv1:
smallFiles: true
engine: wiredTiger
# 如下配置仅对 wiredTiger 引擎生效(3.0 以上版本)
wiredTiger:
engineConfig:
configString: cache_size=1G
cacheSizeGB: 5
# 进程相关参数
processManagement:
fork: true
# 日志相关参数
systemLog:
destination: file
logAppend: true
path: /opt/mongodb-3.4.0/logs/mongodb.log
# 网络相关参数
net:
# 这个端口改成其它的就是无法连接,不知道为啥,还是使用默认的
port: 27017
bindIp: