Problems encountered in Kafka installation

After installation, you can create topic and query, but the producer fails when sending the message: Error Error when sending message to topic testTopic with key:null,value: 1 bytes with error:(org.apache.kafka.clientsproducer.internals .ErrorLoggingCallback)

Have you considered whether there is a problem with your producer/consumer writing? Use the test command of Scheme 3 to try

The basic operation of Kafka:

1.创建topic:
./bin/kafka-topics.sh --create --zookeeper DM-147:2181,DM-148:2181,DM-149:2181 --replication-factor 3 --partitions 3 --topic testTopic
2.查看topic:
./bin/kafka-topics.sh --list --zookeeper DM-147:2181,DM-148:2181,DM-149:218
3.启动生产者:
./bin/kafka-console-producer.sh --broker-list DM-147:2181,DM-148:2181,DM-149:2181 --topic testTopic150
启动消费者:
./bin/kafka-console-consumer.sh --bootstrap-server DM-147:2181,DM-148:2181,DM-149:2181 --topic testTopic150
kafka版本查看:
find ./libs/ -name \*kafka_\* | head -1 | grep -o '\kafka[^\n]*'

Baidu solution:

1. Keep your broker.id and zookeeper's myid consistent;

2. According to this solution, checked the configuration of three kafka services, with

Guess you like

Origin blog.csdn.net/Baron_ND/article/details/114698099