简体   繁体   English

在Kafka中启动多个连接器通过单个分布式工作者连接吗?

[英]Starting multiple connectors in Kafka Connect withing single distributed worker?

How to start multiple Kafka connectors in a Kafka Connect world within a single distributed worker(running on 3 different servers)? 如何在一个分布式工作者(在3台不同的服务器上运行)中的一个Kafka Connect世界中启动多个Kafka连接器

Right now I have a need of 4 Kafka Connectors in this distributed worker(same group.id). 现在,在此分布式工作器(相同的group.id)中,我需要4个Kafka连接器。

Currently, I am adding one connector at a time using following curl command. 目前,我正在使用以下curl命令一次添加一个连接器。

curl -X POST -H "Content-type: application/json" -d '<my_single_connector_config>' 'http://localhost:8083/connectors'

Issue: 问题:

  • For each new connector I add, previous/existing connector(s) restarts along with new connector. 对于我添加的每个新连接器,先前/现有的连接器将与新连接器一起重新启动。

Question: 题:

  • How should I start/create all these new connectors with one REST call in a distributed worker mode? 如何在分布式工作程序模式下通过一个REST调用启动/创建所有这些新连接器?
  • Is there any way to have all connector configs in a single REST call, like an array of connector configs? 有没有办法在单个REST调用中拥有所有连接器配置,例如连接器配置数组?

I tried to search for the same but didn't come across any workaround for this. 我尝试搜索相同的内容,但没有遇到任何解决方法。

Thanks. 谢谢。

For each new connector I add, previous/existing connector(s) restarts along with new connector. 对于我添加的每个新连接器,先前/现有的连接器将与新连接器一起重新启动。

Yes, that's the current behaviour of Kafka Connect. 是的,这就是Kafka Connect的当前行为。 For further discussion see: 有关更多讨论,请参见:

How should I start/create all these new connectors with one REST call in a distributed worker mode? 如何在分布式工作程序模式下通过一个REST调用启动/创建所有这些新连接器? Is there any way to have all connector configs in a single REST call, like an array of connector configs? 有没有办法在单个REST调用中拥有所有连接器配置,例如连接器配置数组?

You can't do it in a single REST call 您无法在单个REST调用中完成此操作


If you want to isolate your connectors from each other when creating/updating them, you can just run multiple distributed clusters. 如果要在创建/更新连接器时将它们相互隔离,则可以只运行多个分布式集群。

So instead of 1 distributed Connect cluster running 3 connectors, you could have 3 distributed Connect clusters each running 1 connector. 因此,您可以有3个分布式Connect群集而不是每个运行3个连接器的1个分布式Connect群集。

Remember in practice a 'distributed Cluster' could just be of a single node, and indeed could all run on the same machine. 请记住,在实践中,“分布式集群”可能只是一个节点,并且实际上都可以在同一台机器上运行。 You'd scale out for resilience and throughput capacity. 您可以横向扩展弹性和吞吐能力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM