Which of the following are the recommended settings when first adding a brand new member to a replica set? Check all that apply:
题目选项
- A.rs.add( { host: HOST:PORT, priority: 1, votes: 0 } )
- B.rs.add( { host: HOST:PORT, priority: 1, votes: 1 } )
- C.rs.add( { host: HOST:PORT, priority: 0, votes: 0 } )
答案置信度:高
正确答案:C
解析语言:中文
新成员刚加入时还没有同步完数据,推荐用 priority: 0、votes: 0 添加(priority: 0 保证它不会被选为 primary,votes: 0 保证这个“空节点”不影响原有投票多数派),等它追平数据后再按需调整。A、B 都给了它 priority 1,B 还给它投票权,会让数据尚未追平的节点有机会被选举为主或改变选举结果。