mongodb等号格式的配置文件转换成yaml格式的配置文件
环境:
mongodb:4.4.22
1.等号格式的配置文件
[root@localhost conf]# more mongo.cnf
port=28001
fork=true
dbpath=/home/middle/mongodb/data
logpath=/home/middle/mongodb/log/mongodb.log
pidfilepath=/home/middle/mongodb/run/28001.pid
logappend=true
bind_ip=192.168.1.108,127.0.0.1
logRotate=reopen
auth=true
wiredTigerCacheSizeGB=1
2.转换
[root@localhost conf]# /usr/local/services/mongodb/bin/mongod -f /home/middle/mongodb/conf/mongo.cnf --outputConfig
config: /home/middle/mongodb/conf/mongo.cnf
net:
bindIp: 192.168.1.108,127.0.0.1
port: 28001
outputConfig: true
processManagement:
fork: true
pidFilePath: /home/middle/mongodb/run/28001.pid
security:
authorization: enabled
storage:
dbPath: /home/middle/mongodb/data
wiredTiger:
engineConfig:
cacheSizeGB: 1
systemLog:
destination: file
logAppend: true
logRotate: reopen
path: /home/middle/mongodb/log/mongodb.log
最后的配置文件需要将如下项去掉
outputConfig: true
路由服务器使用mongos生成
/usr/local/services/mongo_router/bin/mongos -f /home/middle/mongo_router/conf/mongo.cnf --outputConfig