在 Kafka Connect 分布式模式上为多个主题配置连接器
Configuring connectors for multiple topics on Kafka Connect Distributed Mode
我们有生产者向 Kafka 发送以下内容:
- topic=syslog,每天约 25,000 个事件
- topic=nginx,每天约 5,000 个事件
- topic=zeek.xxx.log,每天约 100,000 个事件(总计)。在最后一个案例中,有 20 个不同的 zeek 主题,例如 zeek.conn.log 和 zeek.http.log
kafka-connect-elasticsearch
个实例作为消费者将数据从 Kafka 发送到 Elasticsearch。 kafka-connect-elasticsearch
的 hello-world Sink 配置可能如下所示:
# elasticsearch.properties
name=elasticsearch-sink
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
tasks.max=24
topics=syslog,nginx,zeek.broker.log,zeek.capture_loss.log,zeek.conn.log,zeek.dhcp.log,zeek.dns.log,zeek.files.log,zeek.http.log,zeek.known_services.log,zeek.loaded_scripts.log,zeek.notice.log,zeek.ntp.log,zeek.packet_filtering.log,zeek.software.log,zeek.ssh.log,zeek.ssl.log,zeek.status.log,zeek.stderr.log,zeek.stdout.log,zeek.weird.log,zeek.x509.log
topic.creation.enable=true
key.ignore=true
schema.ignore=true
...
并且可以用bin/connect-standalone.sh
调用。我意识到在单个进程中执行工作时 运行ning 或尝试 运行 tasks.max=24
并不理想。我知道使用分布式模式是更好的选择,但不清楚将连接器提交到分布式模式的性能最佳方式。即,
- 在分布式模式下,我是否仍想通过单个 API 调用仅提交一个
elasticsearch.properties
?还是最好拆分多个 .properties
配置 + 连接器(例如,一个用于 syslog,一个用于 nginx,一个用于 zeek。**)并分别提交?
- 我知道
tasks
等于主题数 x 分区数,但是什么决定了工人的数量?
- 文档中是否有任何地方介绍了针对不同主题的吞吐量明显不平衡的情况的最佳实践?
In distributed mode, would I still want to submit just a single elasticsearch.properties through a single API call?
它会是一个 JSON 文件,但是是的。
what dictates the number of workers?
由你决定。 JVM 使用是您可以监控和扩展的一个因素
据我所知,没有任何文档
我们有生产者向 Kafka 发送以下内容:
- topic=syslog,每天约 25,000 个事件
- topic=nginx,每天约 5,000 个事件
- topic=zeek.xxx.log,每天约 100,000 个事件(总计)。在最后一个案例中,有 20 个不同的 zeek 主题,例如 zeek.conn.log 和 zeek.http.log
kafka-connect-elasticsearch
个实例作为消费者将数据从 Kafka 发送到 Elasticsearch。 kafka-connect-elasticsearch
的 hello-world Sink 配置可能如下所示:
# elasticsearch.properties
name=elasticsearch-sink
connector.class=io.confluent.connect.elasticsearch.ElasticsearchSinkConnector
tasks.max=24
topics=syslog,nginx,zeek.broker.log,zeek.capture_loss.log,zeek.conn.log,zeek.dhcp.log,zeek.dns.log,zeek.files.log,zeek.http.log,zeek.known_services.log,zeek.loaded_scripts.log,zeek.notice.log,zeek.ntp.log,zeek.packet_filtering.log,zeek.software.log,zeek.ssh.log,zeek.ssl.log,zeek.status.log,zeek.stderr.log,zeek.stdout.log,zeek.weird.log,zeek.x509.log
topic.creation.enable=true
key.ignore=true
schema.ignore=true
...
并且可以用bin/connect-standalone.sh
调用。我意识到在单个进程中执行工作时 运行ning 或尝试 运行 tasks.max=24
并不理想。我知道使用分布式模式是更好的选择,但不清楚将连接器提交到分布式模式的性能最佳方式。即,
- 在分布式模式下,我是否仍想通过单个 API 调用仅提交一个
elasticsearch.properties
?还是最好拆分多个.properties
配置 + 连接器(例如,一个用于 syslog,一个用于 nginx,一个用于 zeek。**)并分别提交? - 我知道
tasks
等于主题数 x 分区数,但是什么决定了工人的数量? - 文档中是否有任何地方介绍了针对不同主题的吞吐量明显不平衡的情况的最佳实践?
In distributed mode, would I still want to submit just a single elasticsearch.properties through a single API call?
它会是一个 JSON 文件,但是是的。
what dictates the number of workers?
由你决定。 JVM 使用是您可以监控和扩展的一个因素
据我所知,没有任何文档