嗨,我是 kubernets 的新手,我正在使用 minikube 单节点集群进行本地开发和测试。
Host: Ubuntu 16.04 LTS.
Minikube: Virtual box running minikube cluster
我的要求是我需要在 minikube 上部署 kafka 和 zookeeper,并且应该用于生产或消费消息。我点击此链接并成功将其部署在 minikube 上,其详细信息如下
$ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kafka-service 10.0.0.15 <pending> 9092:30244/TCP 46m
kubernetes 10.0.0.1 <none> 443/TCP 53m
zoo1 10.0.0.43 <none> 2181/TCP,2888/TCP,3888/TCP 50m
zoo2 10.0.0.226 <none> 2181/TCP,2888/TCP,3888/TCP 50m
zoo3 10.0.0.6 <none> 2181/TCP,2888/TCP,3888/TCP 50m
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
kafka-deployment-3583985961-f2301 1/1 Running 0 48m
zookeeper-deployment-1-1598963595-vgx1l 1/1 Running 0 52m
zookeeper-deployment-2-2038841231-tdsff 1/1 Running 0 52m
zookeeper-deployment-3-2478718867-5vjcj 1/1 Running 0 52m
$ kubectl describe service kafka-service
Name: kafka-service
Namespace: default
Labels: app=kafka
Annotations: <none>
Selector: app=kafka
Type: LoadBalancer
IP: 10.0.0.15
Port: kafka-port 9092/TCP
NodePort: kafka-port 30244/TCP
Endpoints: 172.17.0.7:9092
Session Affinity: None
Events: <none>
我已将 KAFKA_ADVERTISED_HOST_NAME 设置为 minikube ip(192.168.99.100)。现在对于消息生产者,我正在使用$cat textfile.log | kafkacat -b $(minikube ip):30244 -t mytopic
它不发布消息,给出以下消息
% Auto-selecting Producer mode (use -P or -C to override)
% Delivery failed for message: Local: Message timed out
任何人都可以帮助如何发布和使用消息。