当遇到MongoDB连接错误时,通常由于MongoDB客户端版本过低。本文指导如何安装新版client,例如在Red Hat 7系统上,针对x86_64架构,从https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.4/x86_64/下载mongodb-org-shell-4.4.4-1.el7.x86_64.rpm包来解决问题。
问题在连接MongoDB的时候出现如下错误:2021-03-12T17:04:17.867+0800 warning: No primary detected for set2021-03-12T17:04:17.867+0800 All nodes for set are down. This has happened for 1 checks in a row. Polling will stop after 29 more failed checks2021-03-12T17:04:17.8