我目前在同一台机器上运行Elasticsearch版本6.2.2和Apache Nifi版本1.5.0。我试图按照位于https://community.hortonworks.com/articles/52856/stream-data-into-hive-like-a-king-using-nifi.html的Nifi示例,除了不存储到Hive,我想存储到Elasticsearch。
最初我尝试使用PutElasticsearch5处理器,但我在Elasticsearch上收到以下错误:
Received message from unsupported version: [5.0.0] minimal compatible version is: [5.6.0]
当我尝试使用Google搜索此错误消息时,似乎共识是使用PutElasticsearchHttp处理器。我的Nifi看起来像:
当流文件到达PutElasticsearchHttp处理器时,会出现以下错误:
PutElasticSearchHttp failed to insert StandardFlowFileRecord into Elasticsearch due to , transferring to failure.
似乎原因是空白/ null。 Elasticsearch日志中也没有任何内容。
在ConvertAvroToJson之后,数据是一个JSON数组,其中所有条目都在一行上。这是一个示例值:
{"City": "Athens",
"Edition": 1896,
"Sport": "Aquatics",
"sub_sport": "Swimming",
"Athlete": "HAJOS, Alfred",
"country": "HUN",
"Gender": "Men",
"Event": "100m freestyle",
"Event_gender": "M",
"Medal": "Gold"}
有关如何调试/解决此问题的任何想法?我是否需要先在Elasticsearch中创建任何内容?我的配置是否正确?