偶然看到Redhet Principal Engineer的一篇slides,內(nèi)容是關(guān)于Telemetry Central Agent Partitioning的。 比較感興趣,先簡單翻譯下從宏觀上了解下。
Background
在Ironic conductors中,使用
連續(xù)哈希環(huán)(consistent hash-ring)來分配節(jié)點(diǎn)。受此方法啟發(fā)。主要想法是當(dāng)共享最小信息時(shí),允許central agents來自我組織。
BP spec中的關(guān)鍵步驟是
blissful ignorance。
How does it work?
啟動多個(gè)central agents。
tooz group membership允許每個(gè)agent知道其他agents的存在。
每個(gè)agent載入相同的discovery extensions。
每個(gè)discoverer都嘗試來discover所有的resources。
但是只poll被分配的resources的子集。
How does the agent know which resources it's been assigned?
每個(gè)discovered resource都有一個(gè)resource ID(UUID, IP addr, etc)。
每個(gè)獨(dú)立的agent使用agent pool的基數(shù)來運(yùn)算一個(gè)list清單做哈希。
我們依賴哈希算法的均勻分布特性。
所以每個(gè)agent能分辨:我是不是該為這個(gè)事情負(fù)責(zé)。
What happens when an agent dies or a fresh agent is started?
每個(gè)agent注冊一個(gè)tooz group membership callback,所以一旦pool中l(wèi)ive agents發(fā)生了變化,所有注冊了的agent都會被通知到。
一旦發(fā)生agent join或者leave,hash清單會改變大小。
在下一次polling cycle中,每個(gè)agent劃分不同的不連續(xù)的子集來決定做哪些resources的discover。
總之,我們覆蓋到所有的resources,以一個(gè)single polling cycle為模。
What are the keys win for this approach?
lightfastsimpleignorantthrifty
Reference
Eoghan Glynn http://www.slideshare.net/EoghanGlynn/hash-based-central-agent-workload-partitioning-37760440