mongodb-replica-set

Can't initiate replica set in Ubuntu

走远了吗. 提交于 2019-11-30 13:40:04
问题 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 } I'm running under google-cloud-engine with latest MongoDB. Any suggestions on how to solve this? 回答1: You could try passing a parameter to the .initiate() command. Like so: rs.initiate({_id:"yourReplSetName", members:

Can't initiate replica set in Ubuntu

你。 提交于 2019-11-30 08:02:35
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 } I'm running under google-cloud-engine with latest MongoDB. Any suggestions on how to solve this? LeBird You could try passing a parameter to the .initiate() command. Like so: rs.initiate({_id:"yourReplSetName", members: [{"_id":1, "host":"yourHost:yourPort"}]}) This did the trick for me. Your VMHOSTNAME must be an alias