繁体   English   中英

将 Conduktor 连接到 Kafka Docker 容器

[英]Connect Conduktor to Kafka Docker container

我需要一个用于测试的小型 kafka 设置。

我是 kafka 新手,我找不到连接到我在 docker 容器中设置的 kafka 的方法:

我尝试使用https://hub.docker.com/r/spotify/kafka/这是一个包含 zookeeper 和 kafka 的容器,但我不知道 kafka 的 Z957B527BCafBD32E80F58D2 是什么:

docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=`docker-machine ip \`docker-machine active\`` --env ADVERTISED_PORT=9092 spotify/kafka

日志:

Digest: sha256:cf8f8f760b48a07fb99df24fab8201ec8b647634751e842b67103a25a388981b
Status: Downloaded newer image for spotify/kafka:latest
/usr/lib/python2.7/dist-packages/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
2020-07-12 19:45:07,018 CRIT Supervisor running as root (no user in config file)
2020-07-12 19:45:07,019 WARN Included extra file "/etc/supervisor/conf.d/kafka.conf" during parsing
2020-07-12 19:45:07,019 WARN Included extra file "/etc/supervisor/conf.d/zookeeper.conf" during parsing
2020-07-12 19:45:07,027 INFO RPC interface 'supervisor' initialized
2020-07-12 19:45:07,027 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2020-07-12 19:45:07,027 INFO supervisord started with pid 1
2020-07-12 19:45:08,031 INFO spawned: 'zookeeper' with pid 8
2020-07-12 19:45:08,034 INFO spawned: 'kafka' with pid 9
2020-07-12 19:45:09,081 INFO success: zookeeper entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-07-12 19:45:09,082 INFO success: kafka entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

我正在使用 kafka-ui 连接到它。 我正在尝试使用:

zookeeper: localhost:2181   <--- working

kafka: localhost:9092 <--- ERROR: "The broker [localhost:9092] is reachable
 but Kafka can't connect. ensure you have access to the *advertised listeners* 
 of the cluster and the proper authorizations."

在此处输入图像描述

不再维护 Spotify 容器。

我建议您遵循 Confluent Docker 快速入门指南或至少使用 Docker Compose 而不是任何一体式 Kafka+ZooKeeper 图像


我还将向您指出蓝色的帮助内容,上面写着“或 Docker?”

但我不知道kafka的ip是什么:

它与 Zookeeper 相同的 IP,因为您在这里只使用单个主机


看来您正在使用 Linux,所以不清楚为什么需要 Docker 机器

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM