Zookeeper issue in setting kafka

2020-03-18 05:30发布

To install kafka , I downloaded the kafka tar folder. To start the server I tried this command :

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

The following error occured on entering the above command:

INFO Reading configuration from: config/zookeeper.properties (org.apache.zookeeper.server.quorum.QuorumPeerConfig)
[2014-08-21 11:53:55,748] FATAL Invalid config, exiting abnormally (org.apache.zookeeper.server.quorum.QuorumPeerMain)
org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing config/zookeeper.properties
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:110)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:99)
    at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:76)
Caused by: java.lang.IllegalArgumentException: config/zookeeper.properties file is missing
    at org.apache.zookeeper.server.quorum.QuorumPeerConfig.parse(QuorumPeerConfig.java:94)
    ... 2 more
Invalid config, exiting abnormally

Is it that I need to setup zookeeper separately? How could I resolve this?

10条回答
叼着烟拽天下
2楼-- · 2020-03-18 06:09

This is basically because of this
java.lang.IllegalArgumentException: config/zookeeper.properties file is missing

it would be really useful if you could share what exactly have you done so far. Also check if the same file exists at the said location and you are running the command from the correct location .. it is supposed to be run from your $KAFKA_HOME folder (where you've extracted the tar file)

查看更多
虎瘦雄心在
3楼-- · 2020-03-18 06:15

You can use Powershell as an alternative to CMD.

Consider myKafka is your kafka home directory, Extract your kafka tar file here. Extracted folder(KafkaDir) will be having ./bin,/config, etc. internal folders.

  1. Now, open Powershell prompt, go to myKafka folder.
  2. Run below command:
.\kafkaDir\bin\windows\zookeeper-server-start.bat
.\kafkaDir\config\zookeeper.properties

Zookeeper will get start.

查看更多
\"骚年 ilove
4楼-- · 2020-03-18 06:17

Have to run in from Kafka home directory, but you are running from the bin.

查看更多
甜甜的少女心
5楼-- · 2020-03-18 06:19

For Windows:

  1. Go to kafka_2.11-2.0.0\bin\windows folder
  2. Then run zookeeper-server-start.bat ../../config/zookeeper.properties
查看更多
ゆ 、 Hurt°
6楼-- · 2020-03-18 06:19

I faced the exact same error, and after a while I realized that the reason for the error was, I wasn't able to find the zookeeper.properties file, and that was because the path wasn't correct, I installed kafka through brew so the config folder was created inside libexec, so find where the config directory is and check for zookeeper.properties inside it and give that path.

查看更多
别忘想泡老子
7楼-- · 2020-03-18 06:20

Had the same issue.

I was following this guide and step 2 mentions to run this command: bin/zookeeper-server-start.sh config/zookeeper.properties I had 2 problems, that first was that I wasn't inside the root directory of the file you untar and the second was that I didn't copy the complete command. Make sure both of them are correct and try again.

查看更多
登录 后发表回答