hadoop - 无法将数据从 Apache 配置单元加载到 ElasticSearch -

标签 hadoop elasticsearch hive hadoop-yarn elastic-stack

我正在使用 CDH5.5,ElasticSearch-2.4.1。
我创建了 Hive 表并尝试使用以下查询将 hive 表数据推送到 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;

我在 Job Tracker 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 终端。

我尝试了论坛中提到的所有步骤,例如在 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 也是。请建议我如何解决该错误。


提前致谢,
斯雷纳特

最佳答案

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

顺便说一句,您应该转到 hadoop MR 日志以查找有关该错误的更多详细信息。

关于hadoop - 无法将数据从 Apache 配置单元加载到 ElasticSearch -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40625648/

相关文章:

hadoop - 无法通过HBase启动Apache Phoenix

hadoop - distcp本质上是否使用SSL/TLS将文件传输到AWS S3

elasticsearch - 我如何使用批注进行类似@Query(value = “{” query“:”“}”的聚合

azure - Hive:两点之间的距离

shell - Oozie shell 操作 - 从 shell 问题运行配置单元

apache-spark - 在 Yarn 上运行 Spark 直线

hadoop - Hadoop FS 的意图是保留在 RAM 还是磁盘中?

elasticsearch - 如何增加完成建议字段的权重?

elasticsearch - ES 中具有多个字段的通配符查询?

hadoop - 将文本加载到 Orc 文件