mongodb 分片集群组件有3部分,
mongos 服务:是路由节点 应用程序跟分片数据节点连接的中间件,
config 服务(元数据):存储分片集的元数据 分片服务(数据节点,存放数据)元数据反映了分片群集内所有数据和组件的状态和组织。元数据包括每个分片上的块的列表以及定义块的范围。 实现方式副本集
shards 服务: 至少是2个复制集
- config 服务复制集配置(启用内部认证机制)
config file 如下
storage:
dbPath: /data/nosql/mongo/mongod/5030/data
journal:
enabled: true
directoryPerDB: true
engine: wiredTiger
wiredTiger:
engineConfig:
cacheSizeGB: 1
directoryForIndexes: true
systemLog:
destination: file
path: /data/nosql/mongo/mongod/5030/logs/mongod.log
logAppend: true
quiet: true
processManagement:
fork: true
pidFilePath: /data/nosql/mongo/mongod/5030/data/mongod.pid
operationProfiling:
slowOpThresholdMs: 1000
replication:
oplogSizeMB: 10240
replSetName: rsconf
security:
keyFile: /data/nosql/mongo/mongod/5030/keys/key
clusterAuthMode: keyFile
sharding:
clusterRole: configsvr