#配置文件内容 # where to write logging data. systemLog: destination: file logAppend: true path: /data/shard1/log/shard1.log # Where and how to store data. storage: dbPath: /data/shard1/data journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 20
# how the process runs processManagement: fork: true pidFilePath: /data/shard1/log/shard1.pid # network interfaces net: port: 27001 bindIp: 192.168.0.33
#配置文件内容 # where to write logging data. systemLog: destination: file logAppend: true path: /data/shard2/log/shard2.log # Where and how to store data. storage: dbPath: /data/shard2/data journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 20 # how the process runs processManagement: fork: true pidFilePath: /data/shard2/log/shard2.pid # network interfaces net: port: 27002 bindIp: 192.168.0.33
#配置文件内容 # where to write logging data. systemLog: destination: file logAppend: true path: /data/shard3/log/shard3.log # Where and how to store data. storage: dbPath: /data/shard3/data journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 20 # how the process runs processManagement: fork: true pidFilePath: /data/shard3/log/shard3.pid # network interfaces net: port: 27003 bindIp: 192.168.0.33
#配置文件内容 # where to write logging data. systemLog: destination: file logAppend: true path: /data/shard4/log/shard4.log # Where and how to store data. storage: dbPath: /data/shard4/data journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 20
# how the process runs processManagement: fork: true pidFilePath: /data/shard4/log/shard4.pid # network interfaces net: port: 27004 bindIp: 192.168.0.35
#配置文件内容 # where to write logging data. systemLog: destination: file logAppend: true path: /data/shard5/log/shard5.log # Where and how to store data. storage: dbPath: /data/shard5/data journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 20
# how the process runs processManagement: fork: true pidFilePath: /data/shard5/log/shard5.pid # network interfaces net: port: 27005 bindIp: 192.168.0.35
rs.initiate(config); { "ok" : 0, "errmsg" : "No host described in new configuration 1 for replica set shard1 maps to this node", "code" : 93, "codeName" : "InvalidReplicaSetConfig" }
最后发现是自己的一个端口号写错了。
启动mongos报错
启动mongos的时候报错:
1 2 3
about to fork child process, waiting until server is ready for connections. forked process: 1436 ERROR: child process failed, exited with error number 1