原文鏈接:http://storm.apache.org/releases/1.0.2/Storm-Scheduler.html
本人原創(chuàng)翻譯突雪,轉(zhuǎn)載請(qǐng)注明出處
Storm現(xiàn)在有四種內(nèi)建的調(diào)度器: DefaultScheduler, IsolationScheduler, MultitenantScheduler, ResourceAwareScheduler济瓢。
可插拔(Pluggable)調(diào)度器
你可以實(shí)現(xiàn)自己的調(diào)度器來替代默認(rèn)調(diào)度器,自定義給workers分配executors的方式括袒。在你的storm.yaml文件中用"storm.scheduler"來配置厦滤,并且你的調(diào)度器必須實(shí)現(xiàn)IScheduler接口援岩。
孤立(Isolation)調(diào)度器
孤立調(diào)度器使多個(gè)topologies可以簡單、安全的共享一個(gè)集群馁害。孤立調(diào)度器可以使你指定哪個(gè)topology應(yīng)該被孤立窄俏,這類被孤立的topology會(huì)運(yùn)行在集群中專用的一組服務(wù)器上,其他topology都不會(huì)在這些服務(wù)器上碘菜。專用服務(wù)器上的資源會(huì)全部分配給孤立topology凹蜈,如果這些服務(wù)器上有其他非孤立topology,那么非孤立topology的運(yùn)行資源也會(huì)被剝奪忍啸。為孤立topology分配完資源之后仰坦,剩下的資源將由剩下的非孤立topology共享。
要配置孤立調(diào)度器首先要在Nimbus的配置中把"storm.scheduler"設(shè)置為"org.apache.storm.scheduler.IsolationScheduler"计雌。然后悄晃,通過"isolation.scheduler.machines"選項(xiàng)來指定每個(gè)topology分配幾個(gè)服務(wù)器。例如:
isolation.scheduler.machines:
"my-topology": 8
"tiny-topology": 1
"some-other-topology": 3
沒在這里列出的topology就不是孤立topology凿滤。Storm的普通用戶無權(quán)修改孤立配置妈橄,只有集群管理員有這個(gè)權(quán)利。
孤立調(diào)度器解決了多租約(multi-tenancy)問題——避免topologies之間的資源競爭翁脆。生產(chǎn)環(huán)境的topologies應(yīng)該進(jìn)行孤立配置眷蚓,開發(fā)和測(cè)試時(shí)則不必。集群中剩下的服務(wù)器扮演了孤立topologies失效備援(failover)和運(yùn)行非孤立topologies兩個(gè)角色反番。