偶然看到Redhet Principal Engineer的一篇slides,内容是关于Telemetry Central Agent Partitioning的。 比较感兴趣,先简单翻译下从宏观上了解下。
Background
在Ironic conductors中,使用
连续哈希环(consistent hash-ring)
来分配节点。受此方法启发。主要想法是当共享最小信息时,允许central agents来自我组织。
BP spec中的关键步骤是
blissful ignorance
。
How does it work?
启动多个central agents。
tooz group membership允许每个agent知道其他agents的存在。
每个agent载入相同的discovery extensions。
每个discoverer都尝试来discover所有的resources。
但是只poll被分配的resources的子集。
How does the agent know which resources it's been assigned?
每个discovered resource都有一个resource ID(UUID, IP addr, etc)。
每个独立的agent使用agent pool的基数来运算一个list清单做哈希。
我们依赖哈希算法的均匀分布特性。
所以每个agent能分辨:我是不是该为这个事情负责。
What happens when an agent dies or a fresh agent is started?
每个agent注册一个tooz group membership callback,所以一旦pool中live agents发生了变化,所有注册了的agent都会被通知到。
一旦发生agent join或者leave,hash清单会改变大小。
在下一次polling cycle中,每个agent划分不同的不连续的子集来决定做哪些resources的discover。
总之,我们覆盖到所有的resources,以一个single polling cycle为模。
What are the keys win for this approach?
light
fast
simple
ignorant
thrifty
Reference
Eoghan Glynn http://www.slideshare.net/EoghanGlynn/hash-based-central-agent-workload-partitioning-37760440