ERROR Error when sending message to topic pro with key: null, value: 5 bytes with error

01 发送消息   kafka版本:  kafka_2.12-2.2.0

kafka 报错信息

在kafka发送消息时的端口错误 导致 2181为zookeeper配置的端口  而kafka配置的为9092

[root@hdp bin]# ./kafka-console-producer.sh --broker-list 192.168.133.102:2181 --topic pro

具体报错

[root@hdp bin]# ./kafka-console-producer.sh --broker-list 192.168.133.102:2181 --topic pro
>hello
[2019-08-16 09:00:09,767] ERROR Error when sending message to topic pro with key: null, value: 5 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Topic pro not present in metadata after 60000 ms.

更改为

[root@hdp bin]# ./kafka-console-producer.sh --broker-list 192.168.133.102:9091 --topic pro

02 消费消息

 [root@hdp bin]# ./kafka-console-consumer.sh  --bootstrap-server 192.168.133.102:9092 --from-beginning --topic pro
hhh
jk

你可能感兴趣的:(kafka)