溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Spark的HA是如何處理的

發(fā)布時(shí)間:2021-12-16 14:21:35 來源:億速云 閱讀:104 作者:iii 欄目:云計(jì)算

本篇內(nèi)容介紹了“Spark的HA是如何處理的”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會(huì)遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

Q1:Master和Driver的是同一個(gè)東西嗎?

  • 兩者不是同一個(gè)東西,在Standalone模式下Master是用于集群資源管理和調(diào)度的,而Driver適用于指揮Worker上的Executor通過多線的方式處理任務(wù)的;

  • Master位于集群的管理節(jié)點(diǎn),一般和 NameNode在同一個(gè)節(jié)點(diǎn)上;

  • Driver一般都位于客戶機(jī)上,客戶機(jī)一般都不屬于集群,但是和集群在同一個(gè)網(wǎng)絡(luò)環(huán)境下,因?yàn)榭蛻魴C(jī)中的Driver要和集群中的Executor頻繁的交互;

Q2:Standalone和Yarn之間如何選擇

  • Standalone和Yarn都是用于資源管理的系統(tǒng),Standalone是專門為Spark打造的資源管理和分配方式,是輕量級的,而Yarn是大數(shù)據(jù)通用的資源管理框架,不僅可以用于管理Spark頂點(diǎn)資源分配,也可以用于管理實(shí)現(xiàn)了Yarn的其它計(jì)算平臺(tái)的資源管理和分配;

  • 如果在生產(chǎn)系統(tǒng)中有多套計(jì)算框架 ,例如Spark、MapReduce、Mahout并存,建議使用Yarn或者M(jìn)esos進(jìn)行資源統(tǒng)一的管理和調(diào)度;如果只使用Spark的話,建議使用Standalone就足夠了,Yarn比較消耗資源;

Q3:Spark 的HA怎么處理的?

  • 對于Master的HA,在Standalone模式下,Worker節(jié)點(diǎn)自動(dòng)是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 “l(fā)eader” 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一般也會(huì)采用ZooKeeper進(jìn)行HA;

“Spark的HA是如何處理的”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI