Reconfig attempted to install a config that would change the implicit default write concern. Use the setDefaultRWConcern command to set a cluster-wide write concern and try the reconfig again.
Posted on 2022-02-22 10:44 高&玉 阅读(857) 评论(0) 编辑 收藏 举报实验测试阶段,删除Arbiter节点报如下错误:
"errmsg" : "Reconfig attempted to install a config that would change the implicit default write concern. Use the setDefaultRWConcern command to set a cluster-wide write concern and try the reconfig again.",
查看复制集配置信息(3个DB节点,1个Arbiter节点):
replicas:PRIMARY> rs.conf()
{
"_id" : "replicas",
"version" : 14,
"term" : 8,
"members" : [
{
"_id" : 0,
"host" : "10.150.57.13:37071",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 1,
"host" : "10.150.57.13:37072",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 2,
"host" : "10.150.57.13:37073",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 3,
"host" : "10.150.57.13:37074",
"arbiterOnly" : true,
"buildIndexes" : true,
"hidden" : false,
"priority" : 0,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
}
],
"protocolVersion" : NumberLong(1),
"writeConcernMajorityJournalDefault" : true,
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {
},
"getLastErrorDefaults" : {
"w" : 1,
"wtimeout" : 0
},
"replicaSetId" : ObjectId("61e62c38d305eeacf7ed8f87")
}
}
当前复制集总共4个节点(3个DB节点,1个Arbiter节点),需要将setDefaultRWConcern修改为2个(参考:官方解决方案):
replicas:PRIMARY> db.adminCommand({
"setDefaultRWConcern" : 2,
"defaultWriteConcern" : {
"w" : 3
}
})
{
#输出如下内容:
"defaultReadConcern" : {
"level" : "local"
},
"defaultWriteConcern" : {
"w" : 2,
"wtimeout" : 0
},
"updateOpTime" : Timestamp(1645495811, 1),
"updateWallClockTime" : ISODate("2022-02-22T02:10:19.308Z"),
"defaultWriteConcernSource" : "global",
"defaultReadConcernSource" : "implicit",
"localUpdateWallClockTime" : ISODate("2022-02-22T02:10:19.312Z"),
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1645495819, 2),
"signature" : {
"hash" : BinData(0,"JtmygH2Lh1ldlTiyOe5xDDOf7vI="),
"keyId" : NumberLong("7054374532596891652")
}
},
"operationTime" : Timestamp(1645495819, 2)
}
再次删除Arbiter节点
replicas:PRIMARY> rs.remove("10.150.57.13:37074")
{
"ok" : 1,
"$clusterTime" : {
"clusterTime" : Timestamp(1645495899, 1),
"signature" : {
"hash" : BinData(0,"QGH1IPMHb6pxPf9UjIoKjf4kYnM="),
"keyId" : NumberLong("7054374532596891652")
}
},
"operationTime" : Timestamp(1645495899, 1)
}
再次查看复制集信息(目前3个DB节点):
replicas:PRIMARY> rs.conf()
{
"_id" : "replicas",
"version" : 15,
"term" : 9,
"members" : [
{
"_id" : 0,
"host" : "10.150.57.13:37071",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 1,
"host" : "10.150.57.13:37072",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
},
{
"_id" : 2,
"host" : "10.150.57.13:37073",
"arbiterOnly" : false,
"buildIndexes" : true,
"hidden" : false,
"priority" : 1,
"tags" : {
},
"secondaryDelaySecs" : NumberLong(0),
"votes" : 1
}
],
"protocolVersion" : NumberLong(1),
"writeConcernMajorityJournalDefault" : true,
"settings" : {
"chainingAllowed" : true,
"heartbeatIntervalMillis" : 2000,
"heartbeatTimeoutSecs" : 10,
"electionTimeoutMillis" : 10000,
"catchUpTimeoutMillis" : -1,
"catchUpTakeoverDelayMillis" : 30000,
"getLastErrorModes" : {
},
"getLastErrorDefaults" : {
"w" : 1,
"wtimeout" : 0
},
"replicaSetId" : ObjectId("61e62c38d305eeacf7ed8f87")
}
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示