【发布时间】:2019-06-26 05:06:51
【问题描述】:
我需要使用 AWS 访问/密钥从我的 Spark 应用程序(结构化流)连接到 AWS Elasticsearch 服务。 例如,S3 和 Spark 集成有一种方法可以在配置中设置访问/秘密密钥https://docs.databricks.com/spark/latest/data-sources/aws/amazon-s3.html
我找不到任何与 Elasticsearch 等效的东西。我尝试了下面的代码,但没有奏效。
val writer = input.write
.option("es.nodes",serverUrl)
.option("es.net.https.auth.user", awsAccessKeyId)
.option("es.net.https.auth.pass", awsSecretAccessKey)
.option("es.nodes.wan.only", "true")
.format("org.elasticsearch.spark.sql")
writer.save("index/mapping")
看起来“es.net.https.auth.xxx”用于基本身份验证。我正在寻找 AWS 特定的。任何信息表示赞赏!
【问题讨论】:
-
如果你还好并且有用,请注意投票。
标签: amazon-web-services apache-spark elasticsearch