无法在 Ubuntu 中启动副本集 [英] Can't initiate replica set in Ubuntu
本文介绍了无法在 Ubuntu 中启动副本集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当我输入:rs.initiate()
,我都会收到以下错误消息:
Whenever I type: rs.initiate()
, I get the following error message:
{
"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 下运行.
I'm running under google-cloud-engine with latest MongoDB.
有关如何解决此问题的任何建议?
Any suggestions on how to solve this?
推荐答案
您可以尝试将参数传递给 .initiate()
命令.
You could try passing a parameter to the .initiate()
command.
像这样:
rs.initiate({_id:"yourReplSetName", members: [{"_id":1, "host":"yourHost:yourPort"}]})
这对我有用.
这篇关于无法在 Ubuntu 中启动副本集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文