dongzhangnong2063 2016-09-29 10:42
浏览 28

too long

We have a mongodb replica set with 3 nodes (db01-03) running as replica set "rs0".

When getting hosts info via MongoClient::getHosts(), the primary server SOMETIMES is being reported twice, once as part of the rs0, once standalone (so it seems?):

{
  "db01.example.com:27017;rs0;...": {
    "host": "db01.example.com",
    "port": 27017,
    "health": 1,
    "state": 2,
    "ping": 0,
    "lastPing": 1475144757
  },
  "db02.example.com:27017;rs0;........": {
    "host": "db02.example.com",
    "port": 27017,
    "health": 1,
    "state": 1,
    "ping": 0,
    "lastPing": 1475144757
  },
  "db03.example.com:27017;rs0;.......": {
    "host": "db03.example.com",
    "port": 27017,
    "health": 1,
    "state": 2,
    "ping": 0,
    "lastPing": 1475144757
  },
  "db02.example.com:27017;-;.......": {
    "host": "db02.example.com",
    "port": 27017,
    "health": 1,
    "state": 1,
    "ping": 0,
    "lastPing": 1475143739
  }
}

Why does this happen, is this intentional/accidental or something we should be concerned about?

Problem is, that our monitoring regularily compares "reported hosts" vs "expected hosts" and we receive alerts since 4 !== 3.

PS:Of course we could fix the alerts by comparing $actual<$expected; that is not the question, but:

Why is the primary sometimes shown twice?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入