DevilKing's blog

冷灯看剑,剑上几分功名?炉香无需计苍生,纵一穿烟逝,万丈云埋,孤阳还照古陵

0%

Gossip, Serf, memberlist, Raft, and SWIM in HashiCorp Consul

原文链接

P2P是一切的源头

Gossip,pull/push,以及binary tree

主要是针对非visibility这种情况?

####SWIM

在点对点的基础上,加上group以及中心节点的定义

In SWIM, no matter how large the group size is, the load per member stays about the same—and that’s regardless of the cluster size

One of the biggest properties of SWIM that we’ll iterate on is the incarnation number. The incarnation number is stored locally on the node—and it’s to help us refute false suspicions. 借由第三者来表达当前nodes的状态

在标准UDP的基础上,加入TCP这样的方式来保证

dogpile,通过多个node的respoonse,加速错误node的剔除

Now anytime we think there’s a suspicion about a node that gets prioritized to the top of the queue.关于suspicion的产生

keyring. one key can encrypt a message, but many keys can decrypt a message.

####Serf

主动退出

The Lamport Clocks we use in Serf are used for every message and every event. We use it to keep the order of things—whereas in memberlist, like we discussed, it’s only used for suspicions. 通过lamport clocks

Raft

用来进行选主,用少量的信息

Consul