一 spark on yarn cluster模式提交作業,一直處於ACCEPTED狀態,改了Client模式後就正常了
阿新 • • 發佈:2018-12-22
1. 提交spark作業到yarn,採用client模式的時候作業可以執行,但是採用cluster模式的時候作業會一直初一accept狀態。
背景:這個測試環境的資源比較小,提交作業後一直處於accept狀態,所以把作業的配置也設定的小。
submit 語句: spark-submit \ spark-submit \ --class a.kafka_streaming.KafkaConsumer \ --master yarn \ --deploy-mode cluster \ --driver-memory 1G \ --num-executors 1 \ --executor-cores 1 \ --executor-memory 1G \ --jars spark-streaming-kafka_2.10-1.6.2.jar,kafka_2.10-0.8.2.1.jar,metrics-core-2.2.0.jar \ my_streaming.jar
2: 報錯如下:
18/03/13 09:51:57 INFO Client: Application report for application_1520510149375_0015 (state: ACCEPTED) 18/03/13 09:51:58 INFO Client: Application report for application_1520510149375_0015 (state: ACCEPTED) 18/03/13 09:51:59 INFO Client: Application report for application_1520510149375_0015 (state: ACCEPTED) 18/03/13 09:52:00 INFO Client: Application report for application_1520510149375_0015 (state: ACCEPTED) 18/03/13 09:52:01 INFO Client: Application report for application_1520510149375_0015 (state: ACCEPTED) 18/03/13 09:52:02 INFO Client: Application report for application_1520510149375_0015 (state: ACCEPTED)
3:環境的資源少了,
4: 措施(最後這個問題還是沒有解決):
1:把以下配置有1G調小,
yarn.scheduler.minimum-allocation-mb: 256m
2 修改capacity-scheduler.xml。
yarn.scheduler.capacity.maximum-am-resource-percent從更改0.1為0.5。
3:也可以把Driver和Executor的記憶體設定到合適位置(不能大也不能小)