2016-11-16 89 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 ........... 

不需要位置

相關問題