「決勝雲計算大數據時代」網絡
Spark亞太研究院100期公益大講堂 【第18期互動問答分享】app
Q1:Master和Driver的是同一個東西嗎?框架
二者不是同一個東西,在Standalone模式下Master是用於集羣資源管理和調度的,而Driver適用於指揮Worker上的Executor經過多線的方式處理任務的; ide
Master位於集羣的管理節點,通常和 NameNode在同一個節點上;大數據
Driver通常都位於客戶機上,客戶機通常都不屬於集羣,可是和集羣在同一個網絡環境下,由於客戶機中的Driver要和集羣中的Executor頻繁的交互;this
Q2:Standalone和Yarn之間如何選擇雲計算
Standalone和Yarn都是用於資源管理的系統,Standalone是專門爲Spark打造的資源管理和分配方式,是輕量級的,而Yarn是大數據通用的資源管理框架,不只能夠用於管理Spark頂點資源分配,也能夠用於管理實現了Yarn的其它計算平臺的資源管理和分配; spa
若是在生產系統中有多套計算框架 ,例如Spark、MapReduce、Mahout並存,建議使用Yarn或者Mesos進行資源統一的管理和調度;若是隻使用Spark的話,建議使用Standalone就足夠了,Yarn比較消耗資源;ip
Q3:Spark 的HA怎麼處理的? 資源
對於Master的HA,在Standalone模式下,Worker節點自動是HA的,對於Master的HA,通常採用Zookeeper;
Utilizing ZooKeeper to provide leader election and some state storage, you can launch multiple Masters in your cluster connected to the same ZooKeeper instance. One will be elected 「leader」 and the others will remain in standby mode. If the current leader dies, another Master will be elected, recover the old Master’s state, and then resume scheduling. The entire recovery process (from the time the the first leader goes down) should take between 1 and 2 minutes. Note that this delay only affects scheduling new applications – applications that were already running during Master failover are unaffected;
對於Yarn和Mesos模式,ResourceManager通常也會採用ZooKeeper進行HA;