mongodb - 无法在 Ubuntu 中启动副本集

标签 mongodb ubuntu google-cloud-platform mongodb-replica-set

每当我输入:rs.initiate() 时,我都会收到以下错误消息:

{
    "info2" : "no configuration explicitly specified -- making one",
    "me" : "VMHOSTNAME:27017",
    "ok" : 0,
    "errmsg" : "No host described in new configuration 1 for replica set rs0 maps to this node",
    "code" : 93
}

我正在使用最新的 MongoDB 在 google-cloud-engine 下运行。

关于如何解决这个问题的任何建议?

最佳答案

您可以尝试将参数传递给 .initiate() 命令。

像这样:

rs.initiate({_id:"yourReplSetName", members: [{"_id":1, "host":"yourHost:yourPort"}]})

这对我有用。

关于mongodb - 无法在 Ubuntu 中启动副本集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28843496/

相关文章:

maven - 如何在 GCP 中向 dataproc 集群添加 jar 依赖?

javascript - 蒙戈错误: cursor killed or timed out - Meteor timeout settings ineffective

javascript - 在 mongodb 的嵌入式文档中返回一个键的最大值

linux - 在 ubuntu 上安装 Postgresql 12 失败 - apt update 有错误

javascript - NPM 安装不起作用 [代码 128]

谷歌云平台上的JSON转NDJSON

google-cloud-platform - bigstore 几乎呈线性增长 Google Cloud

python - MongoDB:查询名称中有空格的键

mongodb - 使用地理空间索引查询源和目的地 mongodb mongomapper

ubuntu - bash_completion 不工作,找不到源命令