Yolean/kubernetes-kafka

Can not sending message to Kafka

Luke7810 opened this issue · 1 comments

I just build kafka bu helm and you can see everything is OK as follow:

$ kubectl get all -n kafka
NAME                         READY   STATUS    RESTARTS   AGE
pod/abc-kafka-0             1/1     Running   0          120d
pod/abc-kafka-1             1/1     Running   0          120d
pod/abc-kafka-2             1/1     Running   0          120d
pod/abc-kafka-zookeeper-0   1/1     Running   0          120d
pod/abc-kafka-zookeeper-1   1/1     Running   0          120d
pod/abc-kafka-zookeeper-2   1/1     Running   0          120d
pod/testclient               1/1     Running   0          120d

NAME                                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/abc-kafka                      ClusterIP   172.21.206.199   <none>        9092/TCP                     120d
service/abc-kafka-headless             ClusterIP   None             <none>        9092/TCP                     120d
service/abc-kafka-zookeeper            ClusterIP   172.21.7.22      <none>        2181/TCP                     120d
service/abc-kafka-zookeeper-headless   ClusterIP   None             <none>        2181/TCP,3888/TCP,2888/TCP   120d

NAME                                    READY   AGE
statefulset.apps/abc-kafka             3/3     120d
statefulset.apps/abc-kafka-zookeeper   3/3     120d

I also can create topic using follow command:
kubectl -n kafka exec testclient -- kafka-topics --zookeeper abc-kafka-zookeeper:2181 --topic test1 --create --partitions 1 --replication-factor 1
But when I want to send a message I will get error as follow:

[~/k8s/kafka]$ kubectl -n kafka exec -ti testclient -- kafka-console-producer --broker-list abc-kafka-headless:9092 --topic test1
>abc
>[2020-04-04 13:04:41,238] ERROR Error when sending message to topic test1 with key: null, value: 3 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for test1-0: 1512 ms has passed since batch creation plus linger time

Any comments?

This repository has nothing to do with helm.