Bash: kafka-topics.sh: command not found

Command not found is printed everytime i am running the above command

@MANOJ1 You need to source the edited bash file. Then you will get the commands.

[sseashu1@gw01 ~]$ source .bash_profile
[sseashu1@gw01 ~]$ kafka-topics.sh --list --zookeeper rm01.itversity.com:2181
–ashok_test_replicated
–ashok_test_replication
BasicProducer
MyFirstKafkaTopic1
PramodTest
SanTest
SanTest1
SaranyaTopic

I have the kafka broker issue

Hi Team,
I have same issue.

i added the below 2 lines in .bash_profile

export KAFKA_HOME=/usr/hdp/2.5.0.0-1245/kafka
PATH=$PATH:$KAFKA_HOME/bin

i run

source .bash_profile

when i run the query

kafka-topics.sh --create --zookeeper \ nn01.itversity.com:2181,nn02.itversity.com:2181,rm01.itversity.com:2181
–replication-factor 1 --partitions 1 --topic kishorekafka1

i am getting Error

bash: kafka-topics.sh: command not found…

Can you try below command and let us know

kafka-topics.sh --create \
  --zookeeper nn01.itversity.com:2181,nn02.itversity.com:2181,rm01.itversity.com:2181 \
  --replication-factor 1 \
  --partitions 1 \
  --topic kafka_demo

Hi Annapurna,

i am still getting same Error

[kishoresoft@gw02 ~]$ kafka-topics.sh --create
om:2181 \keeper nn01.itversity.com:2181,nn02.itversity.com:2181,rm01.itversity.c

–replication-factor 1
–partitions 1
–topic kafka_demo
bash: kafka-topics.sh: command not found…
[kishoresoft@gw02 ~]$

@kishore2 Use the updated path and try again

export KAFKA_HOME=/usr/hdp/current/kafka-broker
PATH=$PATH:$KAFKA_HOME/bin
1 Like

this one is also not working

I have the same error, what can I do to fix it?

This Worked for me… Thanks :slight_smile: