問題1 spark.driver.allowMultipleContexts
-
SparkContext.scala#L79
- 這個(gè)配置項(xiàng)拆開來念spark driver allow multiple contexts, 難得有句英文句子單詞我都認(rèn)識(shí),組合起來還認(rèn)識(shí),可事實(shí)居然完全和這句子相反。
- 這東西絕對(duì)比任何傳銷組織的洗腦口號(hào)強(qiáng)千倍萬倍,剛?cè)肟拥男“妆厝粫?huì)反復(fù)試驗(yàn),前仆后繼。
- JIRA
- [SPARK-4180]SparkContext constructor should throw exception if another SparkContext is already running
- 原來就是為了拋個(gè)異常出來,并不是實(shí)現(xiàn)了multiple contexts,23333。
- [SPARK-4180]SparkContext constructor should throw exception if another SparkContext is already running
- Pull Request
- [SPARK-4180] [Core] Prevent creation of multiple active SparkContexts
- PR的title是prevent,加個(gè)配置項(xiàng)叫allow,老外果然不用上語文課。
問題2 runAsSparkUser
-
SparkHadoopUtil.scala#L63
- 這個(gè)方法是在AM進(jìn)程及Executor進(jìn)程啟動(dòng)之初調(diào)用的,字面意思好像可以傳個(gè)用戶參數(shù)就可以以不同用戶切換
- 啟動(dòng)AM Container及Executor Container如果是Yarn那邊配置了LCE而非DCE的話,這個(gè)用戶應(yīng)該是由Yarn app的提交者確定的,這邊runAsSparkUser封裝部分初始化啟動(dòng)代碼,只能說這邊這個(gè)用戶只能控制executor的初始化,并不能涵蓋task的執(zhí)行。
- 這個(gè)方法寫的也用問題,最后的邏輯都是拿同一個(gè)用戶去創(chuàng)建了兩遍然后去transferCredentials,然后這個(gè)方法也貌似只能轉(zhuǎn)移一個(gè)subject中public的Credential。