2. What information will be returned by rs.status() when it is run on a replica set node? Check all that apply:
题目选项
- A.Heartbeat statistics for each node in the replica set
- B.The IP address and hostname of each of the nodes in the replica set
- C.Whether each node in the replica set is a primary or a secondary
答案置信度:高
正确答案:A、B、C
解析语言:中文
rs.status() 返回的 members 数组对每个成员给出 stateStr(PRIMARY/SECONDARY/ARBITER 等角色)、health/lastHeartbeat/pingMs(心跳与延迟统计)以及 name(主机名:端口,即节点主机信息),三项都能得到。常与它混淆的是 db.serverStatus()(进程级指标)和 rs.printReplicationInfo()(只看 oplog 时间窗)。