【发布时间】:2019-11-04 21:46:27
【问题描述】:
我们在 ec2 中有一个 Kafka 集群。我们在 server.properties 中有 ec2 ip 作为侦听器和adverted.listeners。 (我们还没有 DNS 解析)。我们在 ec2 和 k8s 中都有 MS,都可以连接到这个 kafka 集群并运行。
现在我正在尝试在 k8s 中设置 istio。我在 route53 中创建了 DNS 条目,它将解析为所有 kafka ip,并在 istio 中添加了 ServiceEntry。这应该打开从特使到卡夫卡的端口。
问题是我可以从 istio 做 kafka 主题列表,但不能生产或消费。。 DNS 正在解析,并且 kafka 端口已从 istio 开放
我怀疑我们需要将adverted.listeners 更改为DNS,或者我已经放置了所有集群的IP。我找不到从 istio 到 kafka 的任何解决方案。也没有添加zookeeper服务条目我是否必须添加我只是使用sarama lib连接到kafka?
感谢任何帮助。
kakfa 是 1.0.1 istio 是 1.1.7
我添加了生产者错误。
[2019-06-21 12:41:13,494] WARN [Producer clientId=console-producer] Got error produce response with correlation id 26 on topic-partition test-0, retrying (2 attempts left). Error: UNKNOWN_TOPIC_OR_PARTITION (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,495] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,597] WARN [Producer clientId=console-producer] Got error produce response with correlation id 28 on topic-partition test-0, retrying (1 attempts left). Error: UNKNOWN_TOPIC_OR_PARTITION (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,597] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,704] WARN [Producer clientId=console-producer] Got error produce response with correlation id 30 on topic-partition test-0, retrying (0 attempts left). Error: UNKNOWN_TOPIC_OR_PARTITION (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,704] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
[2019-06-21 12:41:13,808] ERROR Error when sending message to topic test with key: null, value: 0 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition.
[2019-06-21 12:41:13,809] WARN [Producer clientId=console-producer] Received unknown topic or partition error in produce request on partition test-0. The topic-partition may not exist or the user may not have Describe access to it (org.apache.kafka.clients.producer.internals.Sender)
【问题讨论】:
-
您可以发布您的服务条目吗? (没有确切的 IP)。
-
apiVersion:networking.istio.io/v1alpha3 种类:ServiceEntry 元数据:名称:kafka 规范:主机:- kafka.example.net exportTo:-“。”端口:-编号:9092 名称:tcp 协议:TCP 位置:MESH_EXTERNAL 解析:STATIC 端点:-地址:
-地址: -地址: -
@VadimEisenberg 我有一个解决方法。当我输入“位置:MESH_EXTERNAL 分辨率:STATIC”并提供端点时,事情开始起作用,但是当我输入“位置:MESH_EXTERNAL 分辨率:DNS”时,它开始出现错误。我有 rout53 条目正在解决。
-
好的,我很高兴你找到了一个解决方法,它现在对你有用。
-
@vadim,我找到了它,但我对此并不满意。我不喜欢硬编码 ip,因为我们的 Kafka 越来越大,我们必须在服务条目中手动添加 ip 地址。 Cassandra 使用 dns 解析。
标签: kubernetes apache-kafka istio