gpt4 book ai didi

mongodb - MacOS [rsStart] replSet 无法从自身或任何种子 (EMPTYCONFIG) 获取 local.system.replset 配置

转载 作者:IT老高 更新时间:2023-10-28 13:13:21 26 4
gpt4 key购买 nike

我想试试 mongodb 副本集。我按照《MongoDB:权威指南》的步骤。

$ 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)

什么问题?

最佳答案

你需要做的

rs.initiate()

你也可以这样试试

replicaSet.startSet();replicaSet.initiate()

http://docs.mongodb.org/manual/reference/method/rs.initiate/

Initiates a replica set. Optionally takes a configuration argument in the form of a document that holds the configuration of a replica set.

关于mongodb - MacOS [rsStart] replSet 无法从自身或任何种子 (EMPTYCONFIG) 获取 local.system.replset 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25929470/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com