0

我有一个副本集,其中有一个主节点和两个辅助节点。有时我无法连接到主服务器,我得到这个错误,大约一分钟后消失,我能够连接。任何想法为什么会发生这种情况?发生此错误时,我尝试连接到辅助服务器并执行 rs.status ,它表示主服务器仍然是同一台服务器并且运行正常。

以下是来自控制台的显示问题的命令文本。

mongo --host <hostname> --port 27017
MongoDB shell version: 2.2.2
connecting to: <hostname>:27017/test
Sat Mar  2 14:54:02 DBClientCursor::init call() failed
Sat Mar  2 14:54:02 Error: Error during mongo startup. :: caused by :: 10276 DBClientBase::findN: transport error: <hostname>:27017 ns: admin.$cmd query: { whatsmyuri: 1 } src/mongo/shell/mongo.js:93
exception: connect failed


mongo --host <hostname> --port 27017
MongoDB shell version: 2.2.2
connecting to: <hostname>:27017/test
rs0:PRIMARY> 
4

0 回答 0