Where is the kafka/bin location to access kafka shell scripts for the commands like
kafka-topics --bootstrap-server kafka:9092 --list
This results in a blank response. I created topic from docker compose command attribute.
I tried searching,
/etc/kafka # This has only properties files
/opt/ # No subdirectories listed here
I am using the confluentinc/cp-kafka:latest image for spawning the docker image
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
- zookeeper
ports:
- 29092:29092
expose:
- 29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
The docker container is running properly. I need to know :
Thanks!
I would check under /usr/bin, but you do not need the absolute path. The scripts are already on the shell PATH.
created topic from docker compose command
This would override the existing container entrypoint command which starts the broker, unless you mean docker compose exec kafka "kafka-topics --create ..."
Open a shell:
$ docker container ps
$ docker exec -it <container_id> /bin/sh
Find the path to kafka shell scripts:
$ find -name kafka-topics.sh
This command show all kafka's scripts on current docker image:
$ cd /opt/kafka/bin && ls
Kafka docs shows how to do the rest basic operations.
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