微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java – 节点如何知道哪些节点已经看到集群当前状态?

我正在阅读akka文档,并想出了他们实施Gossip的方式的一些麻烦. (docs here).困扰我的那部分,(强调我的):

Periodically, the default is every 1 second, each node chooses another
random node to initiate a round of gossip with. If less than ½ of the
nodes resides in the seen set (have seen the new state) then the
cluster gossips 3 times instead of once every second. This adjusted
gossip interval is a way to speed up the convergence process in the
early dissemination phase after a state change.

因此,如果八卦轮在开始时(少于1/2个节点已经看到当前状态),来自所见集的节点开始每秒发送3个闲话而不是一个.但如果八卦融合发生了,他们怎么知道呢(他们仍然每秒发送三次八卦).或者正如任何其他“集群事件”一样,整个集群中的融合可能是闲话?

解决方法:

你可能知道当看到所有节点时会发生八卦会聚(即所有成员节点都在看到的Gossip事件列表中).如果集群没有收敛,ClusterDeamon会加速八卦.

def gossipTick(): Unit = {
    gossip()
    if (isGossipSpeedupNeeded) {
      scheduler.scheduleOnce(GossipInterval / 3, self, GossipSpeedupTick)
      scheduler.scheduleOnce(GossipInterval * 2 / 3, self, GossipSpeedupTick)
    }
  }

def isGossipSpeedupNeeded: Boolean =
    (latestGossip.overview.seen.size < latestGossip.members.size / 2)

一旦群集收敛,它就会使用配置的八卦间隔回退到正常的预定八卦滴答.看看这个功能sourcetest specs.希望这可以帮助.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐