问题描述
我的测试系统(由于缺乏资源)具有双重mongodb副本集.没有仲裁人.
My test system (due to lack of resources) has a dual mongodb replicaset. There is no arbiter.
在某些系统更改期间,其中一台服务器已停止运行,将不会恢复正常.该服务器恰好托管了主要的mongo节点.这使集合中的唯一其他成员成为辅助成员.
During some system changes one of the servers got put out of action and will not be coming back. This server happened to host the primary mongo node. This left the only other member of the set as a secondary.
我知道集群应该至少有三个节点(我们的产品设置确实如此).
I know I should have had at least three nodes for the cluster (our prod setup does).
有没有办法使现在离线的主服务器降级?我无法更改任何rs.conf()设置,因为唯一的工作节点是辅助节点.启动仲裁程序似乎不起作用,因为当主数据库关闭时,我无法将其添加到副本集.
Is there a way I can make the primary that is now offline to step down? I haven't been able to change any of the rs.conf() settings because the only working node is secondary. starting an arbiter doesn't seem to work because I cannot add it to the replset as the primary is down.
以前有人遇到过并设法解决吗?
Has anyone encountered this before and managed to resolve it?
回顾:
服务器A(主要)-脱机
SERVER A (PRIMARY) - OFFLINE
服务器B(第二)-在线
SERVER B (SECONDARY) - ONLINE
A + B =替换
任何帮助将不胜感激.
推荐答案
当需要.这听起来像您所处的情况.
The mongodb website has documentation for what to do (in an emergency only) when you need to reconfigure a replica set when members are down. This sounds like the situation you are in.
基本上,如果您使用的版本> = 2.0,并且很紧急,则可以将force: true
添加到副本集配置命令中.
Basically, if you're on version >= 2.0, and it's an emergency, you can add force: true
to the replica set configuration command.
这篇关于从辅助节点将辅助节点升级为主要节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!