com.mongodb.MongoCommandException: Command failed with error 211 (KeyNotFound): ‘Cache Reader No keys found for HMAC that is valid for time: { ts: Timestamp(1631260908, 2) } with id: 0’ on server 10.150.3.178:20000. The full response is { “ok” : 0.0, “errmsg” : “Cache Reader No keys found for HMAC that is valid for time: { ts: Timestamp(1631260908, 2) } with id: 0”, “code” : 211, “codeName” : “KeyNotFound”, “operationTime” : { “$timestamp” : { “t” : 1631260908, “i” : 2 } }, “$clusterTime” : { “clusterTime” : { “$timestamp” : { “t” : 1631260908, “i” : 2 } }, “signature” : { “hash” : { “$binary” : “JFDt/nPcZBsXIPTIstQaNHJxH60=”, “$type” : “00” }, “keyId” : { “$numberLong” : “6978738612326105091” } } } }
这个是BUG,需要升级MongoDB版本即可。
1、需要升级到3.6.22 。4.0.22 4.2.12 以及4.4.3
The fix is included in the 3.6.22, 4.0.22, 4.2.12 and 4.4.3 production releases and later. To prevent the issue before upgrading to a fixed release, step down the CSRS primary to initiate a failover before the 90 days limit is reached.
2、临时解决方案对config主节点执行降级。
rs.stepDown()
谢大佬,我去让运维同学试一试,我们的版本是4.2.11。。。。。。