1

我正在尝试使用以下文档在 Knative 中设置 Kafka 通道调度程序:https ://github.com/knative/eventing/tree/master/contrib/kafka/config

一切都很好,只是频道调度员找不到我的 Kafka 经纪人。来自 pod 的错误kafka-channel-dispatcher-0

{"level":"fatal","ts":1554634078.4035408,"caller":"dispatcher/main.go:65","msg":"无法创建 kafka 调度程序。","error":"无法创建kafka client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)","stacktrace":"main.main\n\t/home/michiel/go/src/github.com/knative /eventing/contrib/kafka/cmd/dispatcher/main.go:65\nruntime.main\n\t/usr/lib/go-1.10/src/runtime/proc.go:198"}

我有一个 Kafka 节点在与 K8s 集群不同的机器上运行,但它们在同一个网络中。我尝试在不使用 Knative 的情况下通过运行带有一些 python 的容器来访问 Kafka 代理,这很成功,所以我知道代理是可以访问的。

这是 Kafka 通道调度程序配置图:

apiVersion: v1
kind: ConfigMap
metadata:
  name: kafka-channel-controller-config
  namespace: knative-eventing
data:
  # Broker URL's for the provisioner. Replace this with the URL's for your kafka cluster.
  bootstrap_servers: 10.142.15.232:9092

  # Consumer mode to dispatch events from different partitions in parallel.
  # By default(multiplex), partitions are multiplexed with a single go channel.
  # `multiplex` and `partitions` are valid values.
  ## consumer_mode: partitions

我该怎么做才能联系到我的经纪人?这可能与我提供 IP 地址而不是文档示例中的 url 的事实有关:

# Broker URL's for the provisioner
bootstrap_servers: my-cluster-kafka-bootstrap.my-kafka-namespace:9092

更新: 我可以像文档中那样访问一个 srimzi kafka 集群。

4

0 回答 0