本文说明的是从物理备份文件(数据目录的备份)恢复(重建)mongodb副本集
标题副本集组成:
ip | 角色 | 是否hidde |
---|---|---|
10.0.44.29:27017 | primary | false |
10.0.44.32:27017 | secondary | false |
10.0.44.62:27017 | secondary | tue |
mongod.yaml
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0
security:
keyFile: /opt/mongodb/keyfile
#operationProfiling:
replication:
replSetName: myrs
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
# 开启慢查询日志
operationProfiling:
slowOpThresholdMs: 100
mode: slowOp
</