MongoDB DBA · Question 343 · Multiple choice

62. What information will be returned by rs.status() when it is run on a replica set node? Check all that apply:

Answer options

  1. A.
    Heartbeat statistics for each node in the replica set
  2. B.
    The IP address and hostname of each of the nodes in the replica set
  3. C.
    Whether each node in the replica set is a primary or a secondary

Answer confidence: High

Correct answer: A, B, C

Explanation language: Chinese

rs.status() 返回的 members 数组对每个成员给出 stateStr(PRIMARY/SECONDARY/ARBITER 等角色)、health/lastHeartbeat/pingMs(心跳与延迟统计)以及 name(主机名:端口,即节点主机信息),三项都能得到。常与它混淆的是 db.serverStatus()(进程级指标)和 rs.printReplicationInfo()(只看 oplog 时间窗)。

Papers containing this question

This question appears in 3 bank records. Public pages combine identical prompts and options. Selected questions display the highest-confidence record; the others show a short preview. Paper-based learning preserves each record's answer, explanation, and confidence.

AUTHOR · PROJECTS · OPEN SOURCE

Author & MongoDB projects

Building data platforms, MongoDB migration and sync tools, and cloud operations products.

Contact the author for any MongoDB needs.

Contact the author ↗mlhp123@outlook.com

Support the author

If this question bank helps you, optional donations are welcome.

Scan with Alipay to support the authorOpen full-size donation image ↗