After I installed kafka through homebrew, and my current version is 0.9.0.1.
I was following the steps in this post. At step 3, when I run following command in terminal
kafka-server-start.sh /usr/local/etc/kafka/server.properties
I got: -bash: kafka-server-start.sh: command not found
And I tried to solve this and search for solution for this online and anywhere. But I could not find any.
Does anyone know how to fix this?
The command zkServer.sh is from the ZooKeeper project. The command zookeeper-server-start.sh is from the Kafka project. As it relies on ZooKeeper, it's useful to have a command to start it directly without needing the full ZooKeeper project. The one you use typically depends how/why you use ZooKeeper.
You probably need to put a ./
in front of your command. Like this:
./kafka-server-start.sh /usr/local/etc/kafka/server.properties
This of course you are currently in the $KAFKA_HOME/bin
directory. Alternatively, you could try:
export KAFKA_HOME=/path/to/kafka/install/directory
$KAFKA_HOME/bin/kafka-server-start.sh /usr/local/etc/kafka/server.properties
Or you could do:
export PATH=$KAFKA_HOME/bin:$PATH
And then run your original command without the ./
Please Follow the below steps and it should work as I faced the exact issue
to find the JAVA exact path below is the command
ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 31 Jun 8 01:15 /etc/alternatives/java -> /opt/java/jdk1.8.0_202/bin/java
Set the java home
export JAVA_HOME=/opt/java/jdk1.8.0_202/bin/java
export PATH=$PATH:/opt/java/jdk1.8.0_202/bin/java
set the Kafka path as below
nano .bashrc
export PATH=/home/biraj/kafka_2.12-2.2.1/bin:$PATH
Now the kafka-server-start.sh should work
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