spark-submit, how to specify log4j.properties

前端 未结 6 1930
旧巷少年郎
旧巷少年郎 2021-02-02 00:04

In spark-submit, how to specify log4j.properties ?

Here is my script. I have tried all of combinations and even just use one local node. but looks like the log4j.propert

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 00:31

    1. Copy the spark-defaults.conf to a new app-spark-defaults.conf
    2. Add -Dlog4j.configuration=file://log4j.properties to the spark.driver.extraJavaOptions in the app-spark-defaults.conf. For example:

      spark.driver.extraJavaOptions -XXOther_flag -Dlog4j.configuration=file://log4j.properties

    3. Run your spark using --properties-file to the new conf file. For example :
      spark-submit --properties-file app-spark-defaults.conf --class my.app.class --master yarn --deploy-mode client ~/my-jar.jar

提交回复
热议问题