-bash: bin/kafka-topics.sh: No such file or directory installed via ambari
Asked Answered
P

3

6

Im new in hadoop and apache environment. Now I'm trying to learn about kafka I've installed hadoop via ambari. And i can see that there are some services installed. Including zookeeper . When i click on that service it shows zookeeper server started with green dot. I assume that zookeeper installed correctly. Now i added kafka services. Assuming that kafka and zookeeper installed i try to create some topics according to this source kafka docs.

I try this code

bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

it returns

-bash: bin/kafka-topics.sh: No such file or directory

it makes me wonder if kafka really installed via ambari? i checked ambari services and kafka has been added and the broker is running with started status with green dot.

same thing also happened to zookeeper

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

it returns

-bash: bin/zookeeper-server-start.sh: No such file or directory

Questions

How do i know if any services installed correctly via ambari? I just try this with kafka, but what if i have to add any other source. Are there any other configuration needed after added ther service via ambari?

Thank you.

Pollypollyanna answered 9/6, 2020 at 4:32 Comment(4)
That is a $PATH and-or environment issue with the user that tries to run these commands. Notice how it starts at bin/.... This is not the full path. So the user or application is now in the parent directory of that bin/.Schnorkle
is it means those who installed using ambari haven different command that those insalled manually?Pollypollyanna
That is at the operating system level. You log on the server, you have an environment and certain permissions that apply to your user. Same for the service user that runs ambari. Read on unix user environments and the $PATH variable. Each user can have access to different parts of the system.Schnorkle
Hi, thank you so much for your respond, i will try this real quick with another accessPollypollyanna
P
2

Everything installed with default settings and installed via ambari. I try to locate kafka-topics.sh , and it was located

/usr/hdp/3.1.4.0-315/kafka/bin/kafka-topics.sh

same thing goes for zookeeper-server-start.sh, it was located in

/usr/hdp/3.1.4.0-315/kafka/bin/zookeeper-server-start.sh

i dont know what they are located different than default location.

Pollypollyanna answered 9/6, 2020 at 6:27 Comment(0)
D
9

I found the Kafka binaries under /usr/bin. You can execute a Kafka command for a Dockerize Kafka Broker like this:

docker exec -t kafka_kafka1_1 /usr/bin/kafka-topics --bootstrap-server localhost:9092 --list
Dormeuse answered 3/10, 2020 at 14:14 Comment(0)
P
2

Everything installed with default settings and installed via ambari. I try to locate kafka-topics.sh , and it was located

/usr/hdp/3.1.4.0-315/kafka/bin/kafka-topics.sh

same thing goes for zookeeper-server-start.sh, it was located in

/usr/hdp/3.1.4.0-315/kafka/bin/zookeeper-server-start.sh

i dont know what they are located different than default location.

Pollypollyanna answered 9/6, 2020 at 6:27 Comment(0)
D
0

For that problem when trying to run $ bin/zookeeper-server-start.sh config/zookeeper.properties from git bash

a quick solution is to open kafka-run-class.sh and enable #!/bin/bash, then add "set -x" without the quotation to the next line. run the command again

Repeat the same steps for kafka-server-start by enabling #!/bin/bash and add set -x on the next line. I only got this resolved on git bash.

Drama answered 17/5, 2022 at 3:23 Comment(1)
The clarity and readability of your post might benefit from using this info stackoverflow.com/editing-help I for example find it hard to parse the "without quotation marks. Code formatting probably helps you to make clear what exactly you propose.Student

© 2022 - 2024 — McMap. All rights reserved.