以前有人问过这个问题,但我用的是Hive而不是Spark。所以我不太明白如何将解决方案应用于我的问题。所以我把我的问题贴出来。我正在学习将elasticsearch与hive连接起来,我正在使用此链接。https://www.elastic.co/guide/en/elasticsearch/hadoop/current/hive.html
我在服务器上安装了elasticsearch。我启动了hive并添加了jar文件。
add jar /path/elasticsearch-hadoop-6.3.2.jar;
然后我尝试使用上面链接中给出的查询创建一个表。
CREATE EXTERNAL TABLE table1 (col1 int, col2 string) STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource' = 'warehouse/table1','es.index.auto.create' = 'false');
就在那时我犯了这个错误。
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 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'
我试着设置 'es.nodes.wan.only' = 'true'
但没用。进一步搜索说,执行者可能无法连接到elasticsearch,我需要更改网络配置。但我该怎么做呢?我对elasticsearch是个新手。请帮忙。
暂无答案!
目前还没有任何答案,快来回答吧!