Which command do you use to immediately add a member to a deployed replica set when you are connected to the primary? Choose the best answer:
题目选项
- A.rs.add()
- B.rs.conf()
- C.rs.reconfig()
- D.rs.initiate()
- E.rs.freeze()
答案置信度:高
正确答案:A
解析语言:中文
在 primary 上执行 rs.add("host:port") 会立即把新成员写入副本集配置并发起 reconfig,是"立即添加成员"的标准做法。rs.reconfig() 用于提交整份配置文档(批量/复杂修改时使用),rs.initiate() 只用于首次初始化副本集,rs.conf() 仅读取配置,rs.freeze() 是让成员暂停参加选举。