Scala外部属性,例如Config-server

问题描述 投票:0回答:1

Scala的新手,我们计划用Scala / Spark实施新的应用程序。有没有办法可以拥有类似于Spring Cloud Config Server的外部属性文件?

scala apache-spark spring-cloud
1个回答
0
投票

我以“外部”假设您是指在其他服务器上。

参考:https://spark.apache.org/docs/latest/configuration.html#loading-default-configurations

尚无内置支持,但有两个选择:

  • 作为“预备步骤”,在SPARK_CONF_DIR之前将配置文件下载到主服务器上的spark-submit(或使用--properties-file customconfig.conf作为spark-submit的参数)
  • 在您的应用程序中写一个自定义入口点,该入口点从外部服务器请求文件并使用Properties.load加载它>
© www.soinside.com 2019 - 2024. All rights reserved.