如何恢复仲裁中的节点?

时间:2018-03-10 10:39:19

标签: docker quorum

我已经使用docker建立了一个三节点仲裁网络,如果我的网络崩溃了,我只有其中一个节点的信息。我想使用二进制文件恢复该节点吗?此外,新网络中的块应与其他块同步。请指导它是如何实现的?

1 个答案:

答案 0 :(得分:0)

I assume you’re using docker swarm. The clustering facility within the swarm is maintained by the manager nodes. If for any reason the manager leader becomes unavailable and no enough remaining managers to reach quorum and elect a new manager leader, a quorum is lost and no manager node is able to control the swarm.

In this kind of situations, it may be necessary to re-initialize the swarm and force the creation of a new cluster using the command on the manager leader when it is brought online again:

# docker swarm init --force-new-cluster

This removes all managers except the manager the command was run from. The good thing is that worker nodes will continue to function normally and the other manager nodes should resume functionality once the swarm has been re-initialized.

Sometimes it might be necessary to remove manager nodes from the swarm and rejoin them to the swarm.

But note that when a node rejoins the swarm, it must join the swarm via a manager node.

You can always monitor the health of manager nodes by querying the docker nodes API in JSON format through the /nodes HTTP endpoint:

# docker node inspect manager1 --format "{{ .ManagerStatus.Reachability }}"
# docker node inspect manager1 --format "{{ .Status.State }}"

Also, make it a practice to perform automate the backup of docker swarm config directory /var/lib/docker/swarm to easily recover from disaster.