自动选择节点集群中的领导者 [英] Automatic selection of a leader in a cluster of nodes

查看:107
本文介绍了自动选择节点集群中的领导者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在知道节点随时出现故障的情况下,在群集节点中选择一个主导节点的最佳方法/算法是什么?如果可以使用Java实现,那么它是一个加号。

What are the best methods/algorithms available to select a leading node in a cluster of nodes, knowing that nodes come up and down at anytime? If implementations are available in Java, it is a plus.

推荐答案

我以前在Java中实现过Paxos算法。这非常有用,而且非常简单。 (使用线程模拟服务器花了大约16个小时来演示它。那时我在线程方面也很糟糕!)

I've implemented the Paxos algorith before in Java. It's very useful, and fairly simple. (It took about 16 hours to put together a demo of it, using Threads to simulate servers. I was also much worse at threading then!)

这无济于事您完全选择了领导者...但是它将要做的是允许各个节点就领导者达成一致。因此,您具有这种领导者选择算法,但是由于每个节点都将选择自己的节点来领导,因此您可能会在节点之间发现一场内战。 Paxos算法允许您说出哪个领导者才是真正的领导者。

It won't help you select the leader exactly... but what it will do is allow the various nodes to agree on a leader. So you have this leader selection algorithm, but because each node is going to pick it's own node to lead, you may find a "civil war" among your nodes. The Paxos algorithm allows you to say which picked leader is the real leader.

http://en.wikipedia.org/wiki/Paxos_%28computer_science%29

这篇关于自动选择节点集群中的领导者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆