恢复mongos节点 本文主要介绍恢复mongos节点 步骤 1 准备mongos节点的配置文件和目录。 rm rf /compile/clusterrestore/mgs mkdir p /compile/clusterrestore/mgs1/log mkdir p /compile/clusterrestore/mgs2/log 步骤 2 配置文件(restoreconfig/mongos40301.yaml)。 net: bindIp: 127.0.0.1 port: 40301 unixDomainSocket: {enabled: false} processManagement: {fork: true, pidFilePath: /compile/clusterrestore/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/clusterrestore/mgs1/log/mongos.log} 步骤 3 配置文件(restoreconfig/mongos40302.yaml)。 net: bindIp: 127.0.0.1 port: 40302 unixDomainSocket: {enabled: false} processManagement: {fork: true, pidFilePath: /compile/clusterrestore/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/clusterrestore/mgs2/log/mongos.log} 步骤 4 启动mongo节点。 ./mongos f restoreconfig/mongos40301.yaml ./mongos f restoreconfig/mongos40302.yaml