【发布时间】:2019-09-05 21:08:22
【问题描述】:
大家好,当我使用 Kafka Connect API 将数据下沉到 Elasticsearch 时,我遇到了一个案例。现在我有这个问题。我的配置文件很简单
name=elasticsearch-sink
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
tasks.max=5
topics=myTopicKafka
topic.index.map=myTopicKafka:myIndexES-1
schema.ignore=true
key.ignore=true
connection.url=http://elasticsearch:9200
type.name=kafka-connect
batch.size=200
#linger.ms=500
但在 ES 中,我使用 Curator 来滚动索引
actions:
# 1:
# action: create_index
# description: 'Create mwe.resource.locate index'
# options:
# name: 'myIndexES-1-%Y-%m-%d-1'
2:
action: rollover
description: >-
Rollover the index associated with alias 'myIndexES', after exceeds 500MB memory or is a day old
options:
name: all_myIndexES
conditions:
max_age: 1d
max_size: 500mb
这是每 500MB 创建一个新索引,但索引名称为 myIndexES-00002、myIndexES-00003 等。所以我在这里的问题是如何使用 Kafka Connect API 来支持这一点
【问题讨论】:
标签: elasticsearch apache-kafka apache-kafka-connect