相关文章推荐
活泼的饭卡  ·  python opencv ...·  1 年前    · 
求醉的斑马  ·  PBI Report Server ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

but i have a problem.

My kafka version is kafka 2.11-0.0.0

 $ bin/kafka-server-start.sh config/zookeeper.properties 
[2017-01-31 09:15:55,216] FATAL  (kafka.Kafka$)
org.apache.kafka.common.config.ConfigException: Missing required configuration "zookeeper.connect" which has no default value.
    at org.apache.kafka.common.config.ConfigDef.parse(ConfigDef.java:148)
    at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:49)
    at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:56)
    at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:702)
    at kafka.server.KafkaConfig$.fromProps(KafkaConfig.scala:691)
    at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:28)
    at kafka.Kafka$.main(Kafka.scala:58)
    at kafka.Kafka.main(Kafka.scala)

please help me .

my zookeeper.properties (down)

zookeeper.properties

dataDir=/home/kafka01/zookeeper-data
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0
initLimit=5
syncLimit=2
server.1=kafka01:2888:3888
server.2=kafka02:2888:3888
server.3=kafka03:2888:3888

server.properties

zookeeper.connect=kafka01:2181,kafka02:2181,kafka03:2181

what is the problem??

You are trying to start a kafka server but you are passing the wrong config file.

Usually you want to start a kafka server using the following command:

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

And is in this file where you specify the address of the zookeeper:

zookeeper.connect=kafka01:2181,kafka02:2181,kafka03:2181

The quickstart guide in the kafka official documentation is quite good, I recommend you to have a look at it. You can find it here.

You are trying to start kafka server with zookeeper config properties file and that's why you are getting the above error.

Use the commands below instead:

Zookeeper:

.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

Kafka:

.\bin\windows\kafka-server-start.bat .\config\server.properties
  • Start the zookeeper server separately(on your local or another machine)
  • Start the zookeeper server which is embedded with Kafka server (kafka_2.12/libs/zookeeper-3.4.13.jar)
  • In first case: I am assuming you have started the zookeeper server already and that is running on localhost:2181

    So now you are good to start kafka server using following command

    bin\windows\kafka-server-start.bat ..\..\config\server.properties
    

    In server.properties file you have to tell Kafka server where is/are the zookeeper(s) running. Using property:

    ## zookeeper.connect=localhost:2181 [default]
    zookeeper.connect=zk1:2181, zk2:2181, localhost:2181
    

    In second case

    Start the zookeeper first (embedded with the Kafka server)

    bin\windows\zookeeper-server-start.bat ..\..\config\zookeeper.properties
    

    Then, start the Kafka server:

    bin\windows\kafka-server-start.bat ..\..\config\server.properties
                    I had somehow overridden my server.properties file. this go me on the rite track, thanks. quick google search later, and all good "kafka server.properties example"
    – ASH
                    Oct 21, 2021 at 15:17
    

    This is the error because there is an issue with your command.

    To start zookeeper run -

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

    To start server run -

    kafka-server-start.sh config/zookeeper.properties
    

    You need to start the zookeeper with:

    zookeeper-server-start.sh ~/kafka/config/zookeeper.properties
    

    Then you need to start the kafka-server using:

    kafka-server-start.sh ~/kafka/config/server.properties
    

    Now your kafka will run smoothly

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.