Spark 与 AWS Elastic Search 集成 - 获取 - 云实例没有正确设置“es.nodes.wan.only”错误

问题描述

创建具有公共访问权限的 AWS Elastic 搜索并尝试将数据帧从我的本地推送到 ES,我遇到了以下异常

Exception in thread "main" org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot detect ES version - typically this happens if the network/Elasticsearch cluster is not accessible or when targeting a WAN/Cloud instance without the proper setting 'es.nodes.wan.only'

我在 EMR 中尝试过的相同工作流程并得到相同的异常。阻塞的原因是什么?任何的想法 注意:在maven中配置正确的ES实例jar,下面是我的参考代码

userDF.write.format("org.elasticsearch.spark.sql")
    .option("es.mapping.id","id")
    .option("spark.es.index.auto.create","true")
    .option("spark.es.nodes","https://emrtoser-searchdomain-7uertdoiicyf42hw3rtyhqc7y.us-east-1.es.amazonaws.com") 
    .option("spark.es.batch.size.entries","1000")  
    .option("spark.es.net.http.auth.user","xxxx")
   .option("spark.es.net.http.auth.pass","XXXxxx123#") 
    
    .mode(SaveMode.Overwrite)
    .save("user/data")

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...