Apache Kafka: bootstrap-server is not a recognized option

18,294

Solution 1

According do Apache Kafka Documentation, that can be found here: https://kafka.apache.org/documentation/#quickstart_send, you should use --broker-list property to pass broker address.

Command will be: ./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

EDIT

From Apache Kafka 2.5 both options are supported --broker-list and --bootstrap-server. Suggested one is --bootstrap-server

Solution 2

Following command should work.

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

Solution 3

./kafka-console-consumer.sh --zookeeper localhost:2181 --topic fred

Simply giving this command worked. However in upcoming major release using the option bootstrap-server will be mandatory.

When I use the above command it gives a warning: "Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper]."

Share:
18,294

Related videos on Youtube

Abigail Fox
Author by

Abigail Fox

Updated on June 04, 2022

Comments

  • Abigail Fox
    Abigail Fox 12 months

    I'm trying to set up Apache Kafka to communicate between two virtual machines running CentOS on the same network. I originally set up a Kafka producer and consumer on one machine and everything was running smoothly. I then set up Kafka on the other machine and in the process of trying to get them to connect, I get the error "bootstrap-server is not a recognized option" (I'm running the most recent version of Kafka, 2.2).

    This is what I used to attempt a producer connection:

    bin/kafka-console-producer.sh --bootstrap-server 10.0.0.11:9092 --topic test

    And on the consumer side:

    bin/kafka-console-producer.sh --bootstrap-server 10.0.0.11:9092 --topic test

    The 10.0.0.11 machine is running the server itself.

  • Abigail Fox
    Abigail Fox about 4 years
    On the consumer side, it tells me "--broker-list is not a recognized option"
  • Bartosz Wardziński
    Bartosz Wardziński about 4 years
    @AbigailFox, for consumer is --bootstrap-server, for producer: --broker-list
  • Abigail Fox
    Abigail Fox about 4 years
    my consumer gives me the bootstrap-server error as well. broker-list fixes it for the producer side, but the consumer side still does not work
  • Abigail Fox
    Abigail Fox about 4 years
    It's in the question
  • Bartosz Wardziński
    Bartosz Wardziński about 4 years
    @AbigailFox In the question there is only producer side, that should work after changing property
  • Bartosz Wardziński
    Bartosz Wardziński about 4 years
  • OneCricketeer
    OneCricketeer about 4 years
    If the brokers are on remote machines, the advertised listeners property would need fixing
  • FullStackDeveloper
    FullStackDeveloper about 3 years
    @BartoszWardziński Kakfa official quick start wiki is still '> bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic test '
  • Bartosz Wardziński
    Bartosz Wardziński about 3 years
    @FullStackDeveloper, From version 2.5 option --broker-list is deprecated, and suggestion option is --bootsrap-server. For previous version --broker-list should be used
  • FullStackDeveloper
    FullStackDeveloper about 3 years
    @BartoszWardziński But this tutorial should mention this: kafka.apache.org/quickstart

Related