在kafka docker容器中访问sh文件的kafka bin在哪里- confluentinc/cp-kafka:latest

oyxsuwqo  于 2023-05-21  发布在  Apache
关注(0)|答案(1)|浏览(173)

Kafka/bin位置在哪里,可以访问kafka shell脚本以执行以下命令

kafka-topics --bootstrap-server kafka:9092 --list
This results in a blank response. I created topic from docker compose command attribute.

我试着搜索,

/etc/kafka # This has only properties files
/opt/ # No subdirectories listed here

我使用confluentinc/cp-kafka:latest镜像来生成docker镜像

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

Docker容器运行正常。我需要知道

  • 如何从内部终端手动测试
  • Kafka shell脚本在哪里

谢谢!

yi0zb3m4

yi0zb3m41#

我会在/usr/bin下检查,但你不需要绝对路径。脚本已经在shell PATH中。
从docker compose命令创建主题
这将覆盖启动代理的现有容器入口点命令,除非您指的是docker compose exec kafka "kafka-topics --create ..."

相关问题