偶然看到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