MongoDB 副本集在 rs.initiate()报错

MongoDB 在 rs.initiate()后

1. 出现错误信息:This node was not started with the replSet option

解决方法:检查相关文件夹是否有权限问题。

2.出现如下问题:

"errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: 127.0.0.1:27019 failed with No route to host, 127.0.0.1:27017 failed with No route to host, 127.0.0.1:27018 failed with No route to host",

解决方案:

https://blog.csdn.net/u011808596/article/details/77916188(linux命令)

 

Windows 关闭防火墙相关命令
NetSh Advfirewall set allprofiles state off   #关闭防火墙
Netsh Advfirewall show allprofiles            #查看防火墙状态

3.出现如下问题:

>{
        "operationTime" : Timestamp(0, 0),
        "ok" : 0,
        "errmsg" : "replSetInitiate quorum check failed because not all proposed set members responded affirmatively: 127.0.0.1:27018 failed with Error connecting to 127.0.0.1:27018 :: caused by :: ����Ŀ�����������ܾ����޷����ӡ�, 127.0.0.1:27019 failed with Error connecting to 127.0.0.1:27019 :: caused by :: ����Ŀ�����������ܾ����޷����ӡ�",
        "code" : 74,
        "codeName" : "NodeNotFound",
        "$clusterTime" : {
                "clusterTime" : Timestamp(0, 0),
                "signature" : {
                        "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                        "keyId" : NumberLong(0)
                }
        }
}

 解决方法:

检查副本节点窗口是否关闭了,如果关闭了另开窗口,执行:

mongod --replSet rs0(注:serverName) --port 27018 --dbpath D:\srv\mongodb\rs0-1 --oplogSize 128

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值