conduktor / kafka-stack-docker-compose

docker compose files to create a fully working kafka stack
Apache License 2.0
3.24k stars 1.25k forks source link

How to access access brokers ? #58

Closed injam4u closed 3 years ago

injam4u commented 5 years ago

kafka-topics --bootstrap-server "192.168.99.100:9092" --list is not working

JuanjoA-PH commented 4 years ago

@injam4u this work ok:

$ docker ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED             STATUS              PORTS                                            NAMES
eb2433432ce1        confluentinc/cp-kafka:5.5.1   "/etc/confluent/dock…"   11 minutes ago      Up 11 minutes       0.0.0.0:9092->9092/tcp                           kafka-stack-docker-compose_kafka1_1
1bafe099e903        zookeeper:3.4.9               "/docker-entrypoint.…"   11 minutes ago      Up 11 minutes       2888/tcp, 0.0.0.0:2181->2181/tcp, 3888/tcp       kafka-stack-docker-compose_zoo1_1

$ docker exec kafka-stack-docker-compose_kafka1_1 kafka-topics --list --zookeeper kafka-stack-docker-compose_zoo1_1:2181
__confluent.support.metrics
__consumer_offsets
devshawn commented 3 years ago

As @JuanjoA-PH said, you can access the brokers directly via docker by using docker exec. Locally, it depends on how you are using Docker (or Docker Toolkit).

For example, on Ubuntu with just Docker installed, I can access the brokers by running against localhost:

kafka-topics --bootstrap-server localhost:9092 --list