ERROR Error when sending message to topic

前端 未结 13 2119
借酒劲吻你
借酒劲吻你 2020-12-28 13:46

While producing message in kafka, i am getting the following error :

$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic nil_PF1_P1
hi
hello         


        
13条回答
  •  有刺的猬
    2020-12-28 14:12

    For Apache Kafka v2.11-1.1.0

    Start zookeeper server:

    $ bin/zookeeper-server-start.sh config/zookeeper.properties
    

    Start kafka server:

    $ bin/kafka-server-start.sh config/server.properties
    

    Create one topic name "my_topic":

    $ bin/kafka-topics.sh --create --topic my_topic --zookeeper localhost:2181 --replication-factor 1 --partitions 1
    

    Start the producer:

    $ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic my_topic
    

    Start the consumer:

    $ bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic my_topic --from-beginning
    

提交回复
热议问题