[英]Kafka Connect replication factor for license topic
I'm trying to run Kafka-Connect
locally with docker-compose
.我正在尝试使用
docker-compose
在本地运行Kafka-Connect
。 Much as I like Confluent products and Kafka, it's sometimes a huge quest to pass some config or find one consistent example.就像我喜欢 Confluent 产品和 Kafka 一样,有时传递一些配置或找到一个一致的示例是一项艰巨的任务。 In my docker-compose file, I'm using
6.0.0
versions for broker
, zk
, sr
and kafka-connect
right now, but I've tried older versions as well.在我的 docker-compose 文件中,我现在为
broker
、 zk
、 sr
和kafka-connect
使用6.0.0
版本,但我也尝试过旧版本。
The broker( confluentinc/cp-server:6.0.0
) fails with:代理(
confluentinc/cp-server:6.0.0
)失败:
INFO [Admin Manager on Broker 1]: Error processing create topic request CreatableTopic(name='_confluent-license', numPartitions=1, replicationFactor=3, assignments=[], configs=[CreateableTopicConfig(name='cleanup.policy', value='compact'), CreateableTopicConfig(name='min.insync.replicas', value='2')], linkName=null, mirrorTopic=null) (kafka.server.AdminManager)
信息 [代理 1 上的管理员管理器]:处理创建主题请求 CreatableTopic(name='_confluent-license', numPartitions=1, replicationFactor=3, assignments=[], configs=[CreateableTopicConfig(name='cleanup.policy', value='compact'), CreateableTopicConfig(name='min.insync.replicas', value='2')], linkName=null, mirrorTopic=null) (kafka.server.AdminManager)
And I simply don't know how to pass confluent.topic.replication.factor
as env vars to my workers.而且我根本不知道如何将
confluent.topic.replication.factor
作为环境变量传递给我的工人。 I've added both:我已经添加了两个:
CONNECT_CONFLUENT_TOPIC_REPLICATION_FACTOR: "1"
CONFLUENT_TOPIC_REPLICATION_FACTOR: "1"
...but they are both ignored. ...但它们都被忽略了。 What's more, I can't even find
_confluent-license
mentioned in docs anywhere, only _confluent-command
.更重要的是,我
_confluent-license
无法在任何地方的文档中找到_confluent-license
,只有_confluent-command
。
How can I possibly make connect work locally inside docker-compose
and without setting up 3 brokers?如何在不设置 3 个代理的情况下在
docker-compose
内部进行本地连接?
The broker is failing, because that topic is created from it, so you want the variable on the broker代理失败,因为该主题是从中创建的,因此您需要代理上的变量
KAFKA_CONFLUENT_TOPIC_REPLICATION_FACTOR: 1
Otherwise, you want cp-kafka
, not cp-server
否则,您需要
cp-kafka
,而不是cp-server
As OneCricketeer pointed out, the value must be set in the broker container, and that also explains why it's broker container that fails, not connect workers.正如 OneCricketeer 指出的那样,该值必须在代理容器中设置,这也解释了为什么代理容器失败,而不是连接工作人员。 That definitely makes sense.
这绝对是有道理的。 Broker can't fail because of a misconfigured clients.
代理不会因为客户端配置错误而失败。
What probably made it a lot more confusing to find a solution is that the env var and configuration property for license topic replication factor do not follow a regular pattern where env var is an uppercases configuration property with dots replaced with underscores(and prefix where applicable).找到解决方案可能更令人困惑的是,许可证主题复制因子的 env var 和配置属性不遵循常规模式,其中 env var 是大写的配置属性,点替换为下划线(和前缀在适用的情况下) . In reality we get:
confluent.topic.replication.factor
-> KAFKA_CONFLUENT_TOPIC_REPLICATION_FACTOR
实际上我们得到:
confluent.topic.replication.factor
-> KAFKA_CONFLUENT_TOPIC_REPLICATION_FACTOR
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.