OTHER状态的mongodb副本集成员转换为独立的新副本集primary
################################
有时候,需要将处于OTHER状态的副本集成员的数据恢复到其他副本集,这时候就需要将其状态改为独立的副本集:但是副本集名称不能改变
apple:OTHER> cfg={_id:"apple",members:[{_id:1,host:"10.10.10.10:27007",priority:1}]} { "_id" : "apple", "members" : [ { "_id" : 1, "host" : "10.10.10.10:27007", "priority" : 1 } ] } apple:OTHER> rs.reconfig(cfg,{force:true}); { "ok" : 1, "operationTime" : Timestamp(1626170405, 9208), "$clusterTime" : { "clusterTime" : Timestamp(1626170405, 9208), "signature" : { "hash" : BinData(0,"4xkPCAN/xS7jGNs3wbogA0oIfQU="), "keyId" : NumberLong("6939954830009958401") } } } apple:OTHER>
############################
igoodful@qq.com