Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run Kafka - getting no output in cmd and No such file or directory error in Git Bash

Tags:

apache-kafka

I am setting up Kafka in my local. I have unzipped the 2.12 version and started zookeeper. Zookeeper is up and running but when I am trying to start kafka using the command .\bin\windows\kafka-server-start.bat .\config\server.properties , it is not showing any output.

I have also tried in git bash using the command bin/kafka-server-start.sh config/server.properties , it is giving error as

/c/kafka/kafka_2.12-2.1.0/bin/kafka-run-class.sh: line 306: C:\Program: No such file or directory.

Can you please help me with the solution.

like image 558
anurag Avatar asked Dec 05 '22 10:12

anurag


1 Answers

I use git bash on windows, and run the scripts in kafka_2.12-2.2.0\bin (not kafka_2.12-2.2.0\bin\windows).

Add double quotes around the JAVA term, in line 306.

exec "$JAVA" $KAFKA_HEAP_OPTS $KAFKA_JVM_PERFORMANCE_OPTS $KAFKA_GC_LOG_OPTS $KAFKA_JMX_OPTS $KAFKA_LOG4J_OPTS -cp $CLASSPATH $KAFKA_OPTS "$@"

If that does not help, add "set -x" at the top of the "kafka-run-class.sh" script to see the real problem.

#!/bin/bash
set -x
like image 63
Sagan Avatar answered May 22 '23 05:05

Sagan