spark with aws elastic search integration-getting-cloud示例没有正确设置'es.nodes.wan.only'错误

i7uq4tfw  于 2021-07-12  发布在  Spark
关注(0)|答案(0)|浏览(447)

创建具有公共访问权限的awsElasticSearch,并尝试将dataframe从本地推送到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")

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题