2016-11-16 50 views
0

我正在使用CDH5.5,ElasticSearch-2.4.1。 我创建了Hive表并尝试使用以下查询将Hive表数据推送到ElasticSearch。
无法将数据从Apache配置单元加载到ElasticSearch -

CREATE EXTERNAL TABLE test1_es(
    id string, 
    timestamp string, 
    dept string)<br> 
ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe' 
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' 
LOCATION 
    'hdfs://quickstart.cloudera:8020/user/cloudera/elasticsearch/test1_es' 
TBLPROPERTIES ( 'es.nodes'='localhost', 
'es.resource'='sample/test1', 
'es.mapping.names' = 'timestamp:@timestamp', 
'es.port' = '9200', 
'es.input.json' = 'false', 
'es.write.operation' = 'index', 
'es.index.auto.create' = 'yes' 
);<br> 
INSERT INTO TABLE default.test1_es select id,timestamp,dept from test1_hive; 

我提示以下错误:在作业调度器URL “

Failed while trying to construct the redirect url to the log server. Log Server url may not be configured. <br> 
java.lang.Exception: Unknown container. Container either has not started or has already completed or doesn't belong to this node at all. " 

将在蜂巢终端扔"FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask"

我试着像论坛中提到的所有步骤包括hive-site.xml中的/usr/lib/hive/bin/elasticsearch-hadoop-2.0.2.jar,将ES-hadoop jar添加到HIVEAUXJARS_PATH中,将yarn jar复制到/usr/lib/hadoop/elasticsearch-yarn-2.1 .0.Beta3.jar也请。建议我如何解决错误。


由于事先 斯里纳

回答

0

我处理同样的问题,我发现蜂巢抛出执行错误是由字符串类型的时间戳字段,无法解析造成的。我想知道是否字符串类型的时间戳字段可以正确映射到es,如果不是这可能是根本原因。

顺便说一下,你应该去hadoop MR日志找到有关错误的更多细节。

0
REATE EXTERNAL TABLE test1_es(
    id string, 
    timestamp string, 
    dept string)<br> 
ROW FORMAT SERDE 'org.elasticsearch.hadoop.hive.EsSerDe' 
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' 
TBLPROPERTIES ........... 

不需要位置

相关问题