恢復mongos節點
更(geng)新時間 2023-12-08 17:04:21
最近更新時間(jian): 2023-12-08 17:04:21
分享(xiang)文章
本文主要介紹恢復mongos節點(dian)
步(bu)驟 1 準備mongos節(jie)點的配(pei)置(zhi)文件和目錄。
rm -rf /compile/cluster-restore/mgs*
mkdir -p /compile/cluster-restore/mgs1/log
mkdir -p /compile/cluster-restore/mgs2/log
步驟(zou) 2 配置文件(restoreconfig/mongos_40301.yaml)。
net:
bindIp: 127.0.0.1
port: 40301
unixDomainSocket: {enabled: false}
processManagement: {fork: true, pidFilePath: /compile/cluster-restore/mgs1/mongos.pid}
sharding: {configDB: 'config/127.0.0.1:40303,127.0.0.1:40304,127.0.0.1:40305'}
systemLog: {destination: file, logAppend: true, logRotate: reopen, path: /compile/cluster-restore/mgs1/log/mongos.log}
步驟 3 配置文件(restoreconfig/mongos_40302.yaml)。
net:
bindIp: 127.0.0.1
port: 40302
unixDomainSocket: {enabled: false}
processManagement: {fork: true, pidFilePath: /compile/cluster-restore/mgs2/mongos.pid}
sharding: {configDB: 'config/127.0.0.1:40303,127.0.0.1:40304,127.0.0.1:40305'}
systemLog: {destination: file, logAppend: true, logRotate: reopen, path: /compile/cluster-restore/mgs2/log/mongos.log}
步(bu)驟 4 啟動mongo節點。
./mongos -f restoreconfig/mongos_40301.yaml
./mongos -f restoreconfig/mongos_40302.yaml