我正在使用以下配置部署分片的mongodb集群:
副本集中的3个Mongod实例
副本集中的3个配置服务器实例
1个mongos实例
我正在尝试使用以下命令启动mongos实例,但mongos实例无法连接。这是我得到的错误:
2020-03-04T00:59:49.312+0000 W NETWORK [mongosMain] Unable to reach primary for set crepset
2020-03-04T00:59:49.747+0000 W NETWORK [monitoring keys for HMAC] Unable to reach primary for set crepset
2020-03-04T00:59:49.818+0000 W NETWORK [mongosMain] Unable to reach primary for set crepset
2020-03-04T00:59:50.254+0000 W NETWORK [monitoring keys for HMAC] Unable to reach primary for set crepset
2020-03-04T00:59:50.323+0000 W NETWORK [mongosMain] Unable to reach primary for set crepset
2020-03-04T00:59:50.762+0000 W NETWORK [monitoring keys for HMAC] Unable to reach primary for set crepset
2020-03-04T00:59:50.829+0000 W NETWORK [mongosMain] Unable to reach primary for set crepset
2020-03-04T00:59:51.268+0000 W NETWORK [monitoring keys for HMAC] Unable to reach primary for set crepset
2020-03-04T00:59:51.268+0000 I NETWORK [monitoring keys for HMAC] Cannot reach any nodes for set crepset. Please check network connectivity and the status of the set. This has happened for 1261 checks in a row.
我运行以下命令来启动实例:
mongos --configdb crepset/host1:27019>,<host2:27019>,<host3:27019> --port 27017 --logpath /var/log/mongodb/mongos.log --keyFile /etc/mongokeyfile --sslMode requireSSL --sslPEMKeyFile /etc/MongoAuthCert.pem --sslPEMKeyPassword <pwd>
我可以将mongo shell连接到配置服务器副本集,并从mongos实例获取该集的状态。有人可以告诉我为什么我看到此错误吗?