You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否为单个Kafka Connect配置多个Sink连接器?

Can a single Kafka Connect instance/cluster run multiple Sink connectors?

Absolutely! Kafka Connect is designed from the ground up to support running multiple independent connectors (both Sink and Source types) on the same cluster or standalone instance. Each connector operates as a separate logical unit, sharing the underlying Connect resources while maintaining its own configuration and task lifecycle.

How to add multiple Sink connectors (using your Cassandra Sink example)

You can use the same kafka-connect-cli tool you're already using to create additional Sink connectors—you just need to ensure each has a unique identifier.

For example, if you already have your cassandra-sink-orders connector set up, you can create a second Cassandra Sink to handle a payments-topic with a new configuration file:

java -jar kafka-connect-cli-0.5-all.jar create cassandra-sink-payments < cassandra-sink-distributed-payments.properties

Key configuration rules to follow:

  • Unique name property: Every connector must have a distinct name value (like cassandra-sink-orders vs cassandra-sink-payments)—this is how Kafka Connect differentiates between connectors.
  • Isolated topic mappings: Each Sink can target different Kafka topics (via the topics property) or even overlap topics if your business logic requires it.
  • Task scaling: Adjust tasks.max per connector based on the throughput needs of that specific Sink.

Alternative: Using the Kafka Connect REST API (distributed mode preferred)

In distributed Kafka Connect mode, the REST API is the standard way to manage connectors. To add a second Sink, you can send a POST request with your new connector's JSON configuration:

curl -X POST -H "Content-Type: application/json" --data @cassandra-sink-payments.json http://your-connect-cluster-host:8083/connectors

Things to keep in mind:

  • Ensure your Kafka Connect cluster has enough memory and CPU resources to handle the combined load of all connectors and their tasks.
  • Verify that each Sink's configuration (like Cassandra connection details, table mappings) doesn't conflict with others (e.g., if targeting the same Cassandra cluster, make sure table schemas align with the incoming topic data).
  • You can check the status of all running connectors at any time with:
    curl http://your-connect-cluster-host:8083/connectors
    

内容的提问来源于stack exchange,提问作者el323

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:36:54