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


版权声明:本文为qq_36148522原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。