问题描述:
在给客户搭建环境的时候,在初始化一个MongoDB副本集的过程中,出现了初始化失败,报"No host described in new configuration 1 for replica set mongotest maps to this node"。具体报错信息如下(为保护客户隐私,IP均经过处理):
2018-06-20T11:51:45.695+0800 I CONTROL [initandlisten]
> config = { _id:"mongotest", members:[ {_id:0,host:"10.0.0.217:27017"}] };
{
"ok" : 0,
"errmsg" : "No host described in new configuration 1 for replica set mongotest maps to this node",
"code" : 93,
"codeName" : "InvalidReplicaSetConfig"
原因分析:
看到"No host described in new configuration 1 for replica set mongotest maps to this node"的提示,怀疑是命令行和mongo.conf文件里面的配置不一致,但是查看配置文件,确实配置的是mongotest: