【问题标题】:Load properties file in Spark classpath during spark-submit execution在 spark-submit 执行期间在 Spark 类路径中加载属性文件
【发布时间】:2020-07-20 09:40:09
【问题描述】:

我正在 Spark 提交脚本中安装 Spark Atlas 连接器 (https://github.com/hortonworks-spark/spark-atlas-connector) 由于安全限制,我无法将 atlas-application.properties 放入 spark/conf 存储库中。

我在 spark-submit 中使用了这两个选项:

--driver-class-path  "spark.driver.extraClassPath=hdfs:///directory_to_properties_files" \
--conf "spark.executor.extraClassPath=hdfs:///directory_to_properties_files" \

当我启动 spark-submit 时,我遇到了这个问题:

20/07/20 11:32:50 INFO ApplicationProperties: Looking for atlas-application.properties in classpath
20/07/20 11:32:50 INFO ApplicationProperties: Looking for /atlas-application.properties in classpath
20/07/20 11:32:50 INFO ApplicationProperties: Loading atlas-application.properties from null

【问题讨论】:

  • 这能回答你的问题吗? loading properties with spark-submit
  • 属性文件已经在 HDFS 中可用,而不是在 spark-submit 中传递参数或配置。编写代码以从 spark 代码中的 hdfs 读取数据

标签: apache-spark hadoop apache-atlas


【解决方案1】:

请参阅 CDP Atals 配置文章。

https://community.cloudera.com/t5/Community-Articles/How-to-pass-atlas-application-properties-configuration-file/ta-p/322158

客户端模式:

spark-submit --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode client --driver-java-options="-Datlas.conf=/tmp/" /opt/cloudera/parcels/CDH/jars/spark-examples*.jar 10

集群模式:

sudo -u spark spark-submit --class org.apache.spark.examples.SparkPi --master yarn --deploy-mode cluster --files /tmp/atlas-application.properties --conf spark.driver.extraJavaOptions="-Datlas.conf=./" /opt/cloudera/parcels/CDH/jars/spark-examples*.jar 10

【讨论】:

    猜你喜欢
    • 2017-01-14
    • 2021-02-24
    • 2019-01-09
    • 2014-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-12
    相关资源
    最近更新 更多