Reputation: 2314
I have Kafka running as a container, and i want to create a topic.
When i attempt the following command:
docker exec -it [container_id] /bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
I receive the following error:
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"/bin/kafka-topics.sh\": stat /bin/kafka-topics.sh: no such file or directory": unknown
How can i accomplish the creation of a topic?
Upvotes: 4
Views: 2838
Reputation: 26885
It's because the kafka-topics.sh
tool is not in /bin
!
A quick look at the Dockerfile shows it's under /opt/kafka_2.11-0.10.1.0
Try:
docker exec -it [container_id] /opt/kafka_2.11-0.10.1.0/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
Upvotes: 7