Storm學習第三天

調度器:


Storm有四種內置的調度器:DefaultScheduler, IsolationScheduler, MultitenantScheduler, ResourceAwareScheduler.


Pluggable scheduler:
        爲了給worker安排executor你可以通過自定義調度器來代替默認的調度器,可以在storm.yaml中使用storm.scheduler來配置調度器,但是自定義的調度器必須實現IScheduler接口。


Isolation scheduler:
          isolation scheduler使得很多topology分享一個集羣是安全方便的,isolation scheduler使得定製化哪些topologies應該被孤立,意味着他們能夠運行在集羣中的一些特定機器上,其他的topology不能運行在這些機器上。這些獨立的topology在集羣中被給予很高的優先權,所以與其他的topology競爭資源的時候,這些topology將會得到資源,甚至爲了確保這些獨立topology獲得足夠的資源,非獨立的topology的資源可能被搶佔,所有的獨立topology獲得資源之後,剩下的機器會被非獨立的topology獲得。
          你可以在Nimbus中配置"storm.scheduler"爲"org.apache.storm.scheduler.IsolationScheduler" 來實現獨立topology的配置,
然後通過設置"isolation.scheduler.machines"爲每個獨立的topology設置他所需要的機器數量,例如:
        isolation.scheduler.machines: 
                             "my-topology": 8
                             "tiny-topology": 1
                             "some-other-topology": 3 
被提交到集羣的topology沒在上面列表中的將不會被獨立,注意只有管理員權限可以設置這個,普通用戶是不行的。
isolation scheduler 通過在topologies中提供隔離解決了資源競爭問題,這樣做的目的是生產環境的topology應該被獨立,還在測試或者開發的不應該在這之中,集羣中剩下的機器是雙重角色,一方面是獨立topology的故障轉移和非獨立topology的運行。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章