问题描述
创建具有公共访问权限的 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 (将#修改为@)