MongoDB DBA · Question 402 · Single choice

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:

Answer options

  1. A.
    rs.add()
  2. B.
    rs.conf()
  3. C.
    rs.reconfig()
  4. D.
    rs.initiate()
  5. E.
    rs.freeze()

Answer confidence: High

Correct answer: A

Explanation language: Chinese

在 primary 上执行 rs.add("host:port") 会立即把新成员写入副本集配置并发起 reconfig,是"立即添加成员"的标准做法。rs.reconfig() 用于提交整份配置文档(批量/复杂修改时使用),rs.initiate() 只用于首次初始化副本集,rs.conf() 仅读取配置,rs.freeze() 是让成员暂停参加选举。

Papers containing this question

This question appears in 2 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 ↗