【问题标题】:Writing data from spark to elasticsearch: Connection error将数据从 spark 写入 elasticsearch:连接错误
【发布时间】:2022-10-17 18:42:07
【问题描述】:

我正在使用 spark-es 连接器将 2000 万行数据写入 Elasticsearch (Azure Cloud)。成功写入 1300 万后,出现以下错误:


    Caused by: EsHadoopNoNodesLeftException: Connection error (check network and/or proxy settings)- all nodes failed; tried [[.......westeurope.azure.elastic-cloud.com:9243]]

我的代码:将数据从 spark 写入 Elastic:

data
          .write
          .format("org.elasticsearch.spark.sql")
          .option("es.nodes", node)
          .option("es.port", port)
          .option("es.net.http.auth.user", username)
          .option("es.net.http.auth.pass", password)
          .option("es.net.ssl", "true")
          .option("es.nodes.wan.only", "true")
          .option("es.mapping.id", "id")
          .mode(writingMode)
          .save(index)

任何帮助或建议将不胜感激!

【问题讨论】:

  • 您的弹性集群很可能对您发送的数据量不太满意。可能有很多东西,磁盘空间?中央处理器 ? ...您应该检查Elasticsearch 日志

标签: elasticsearch databricks elasticsearch-spark


【解决方案1】:

当您执行 spark-submit 时,请尝试使用以下参数: 驱动内存 执行者记忆

对于我的设置,以下工作。我不知道你的系统规格,你可以尝试使用高值。

/spark/bin/spark-submit --driver-memory 4g --executor-memory 6g <jarname.jar>

问题很可能与您对系统的负载量有关,而不是您的 spark 和 elasticsearch 连接。

【讨论】:

    猜你喜欢
    • 2018-08-13
    • 2017-01-02
    • 1970-01-01
    • 2017-12-01
    • 1970-01-01
    • 2017-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多