If anyone else is facing this issue:
I had the exact same problem and I finally solved it. the problem is that you have space character in your path (inside folder names) which causes "dirname" command to receive more than one argument.
Therefore, in order to solve, you only need to remove space from folder names within your Kafka folder path.
Follow below steps for windows & kafka 0.9.0.0 (same steps will go with lower versions of kafka) First download binary from: https://www.apache.org/dyn/closer.cgi?path=/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz
extract to your particular folder and then
Step 1: create new directories in your kafka directory
- kafka-logs
- zookeeper
your directory after step 1 will be :
- bin
- config
- kafka-logs
- libs
- site-docs
- zookeeper
Step 2: Open config/server.properties and change below property
- log.dirs={fullpath}/kafka-logs
Step 3: Open config/zookeeper.properties and change belwo property
- dataDir={fullpath}/zookeeper
Step 4: create a run.bat file under bin/windows folder with following script:
start zookeeper-server-start.bat ..\..\config\zookeeper.properties
TIMEOUT 10
start kafka-server-start.bat ..\..\config\server.properties
exit
You can change timeout for your convenience.
Here i think you downloaded kafka source. you need to download binary
https://www.apache.org/dyn/closer.cgi?path=/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz
Follow below steps to resolve this error.
step1: Get inside kafka downloaded folder
cd kafka-2.5.0-src
step2: Run gradle
./gradlew jar
step3: Once build is successful, start the kafka server
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
Now Kafka will be starts on localhost:9092
Had the same problem and it was because I download the source file instead of the binary file.
If you are using the Kafka source to run the Kafka server on the Windows 10 machine. We need to build the source first using the below step.
Please note: we need to have gradle build tool installed and path variable set before following the below steps.
Open the command prompt and navigate to the Kafka home directory
C:\kafka-1.1.1-src>
Enter the command 'gradle' and press Enter
C:\kafka-1.1.1-src>gradle
Once the build is successful enter the below command
C:\kafka-1.1.1-src>gradlew jar
Now enter the below command to start the server
C:\kafka-1.1.1-src>.\bin\windows\kafka-server-start.bat .\config\server.properties
If everything went fine, your command prompt will look like this one
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With