我想尝试mongodb副本集。我按照“MongoDB:The Definitive Guide”的步骤进行操作。
$ mongo --nodb
然后在mongo shell中:
replicaSet = new ReplicaSet({nodes: 3})
replicaSet.startSet()
然后终端重复输出:
[rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)
什么'问题?
答案 0 :(得分:17)
你需要做
rs.initiate()
您也可以尝试这样
replicaSet.startSet();replicaSet.initiate()
http://docs.mongodb.org/manual/reference/method/rs.initiate/
启动副本集。 (可选)以包含副本集配置的文档形式获取配置参数。