基本配置 -------------------------------------------------------------------------------- * Replicaton 参数 -------------------------------------------------------------------------------- * 主/从参数 -------------------------------------------------------------------------------- * Replica set(副本集)选项: -------------------------------------------------------------------------------- * Sharding(分片)选项 -------------------------------------------------------------------------------- # 上述参数都可以写入 mongod.conf 配置文档里例如: dbpath = /data/mongodb logpath = /data/mongodb/mongodb.log logappend = true port = 27017 fork = true auth = true
e.g:./mongod -shardsvr -replSet shard1 -port 16161 -dbpath /data/mongodb/data/shard1a -oplogSize 100 -logpath /data/mongodb/logs/shard1a.log -logappend -fork -rest |