2. What information will be returned by rs.status() when it is run on a replica set node? Check all that apply:
题目选项
- A.The IP address/hostname and the port
- B.Heartbeat statistics for each node in the replica set
- C.Whether each node in the replica set is a primary or a secondary
答案置信度:高
正确答案:A、B、C
解析语言:中文
rs.status() 返回 members 数组,每个成员包含 host(主机名/IP 加端口,A)、成员之间的心跳与复制延迟等统计信息(B),以及 stateStr 表示的角色(PRIMARY/SECONDARY/ARBITER,C)。“每个节点是 primary 还是 secondary”就对应 stateStr 字段,故三项都会返回。