ITPub博客

首页 > 数据库 > NoSQL > MongoDB日常运维-06副本集搭建错误汇总

MongoDB日常运维-06副本集搭建错误汇总

原创 NoSQL 作者:chenoracle 时间:2020-03-22 22:58:40 1 删除 编辑

MongoDB日常运维-06副本集搭建错误汇总

一:MongoDB常用命令汇总

二:MongoDB安装

三:MongoDB主从复制搭建

四:MongoDB副本集搭建 

五:MongoDB副本集故障切换

六:MongoDB副本集搭建错误汇总


六:MongoDB副本集搭建错误汇总

错误一:

集群初始化时,报错:

replSetInitiate quorum check failed because not all proposed set members responded affirmatively

: 192.168.2.187:27017 failed with Error connecting to 192.168.2.187:27017 :: 

caused by :: Connection refused, 192.168.2.188:27017 failed with Error 

connecting to 192.168.2.188:27017 :: caused by :: Connection refused"

如下:

> rs.initiate(config)

{

"ok" : 0,

"errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: 192.168.2.187:27017 failed with Error connecting to 192.168.2.187:27017 :: caused by :: Connection refused, 192.168.2.188:27017 failed with Error connecting to 192.168.2.188:27017 :: caused by :: Connection refused",

"code" : 74,

"codeName" : "NodeNotFound"

}

问题原因:

主从库配置文件里没有配置 bind_ip参数,默认只能远程连接数据库

可以在从节点远程连接主库进行测试

mongo --host 192.168.2.222 --port 27017

也会出现Connection refused错误

解决方案:

主从库配置文件mongodb.conf添加bind_ip参数,重启数据库。

bind_ip = 0.0.0.0

欢迎关注我的微信公众号"IT小Chen",共同学习,共同成长!!!    

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29785807/viewspace-2681970/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle ACE、OCMU 用户组成员、Oracle 11g OCM、微信公众号"IT小Chen"

注册时间:2014-08-05

  • 博文量
    853
  • 访问量
    2727927