-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation on how to set up docker-compose.yml? #44
Comments
Hi, No problem, I've been meaning to add Docker Compose examples for ages, in fact I have some sitting around in my local working copy that I just need to polish up and push. In the meantime this ought to be pretty close: version: '3'
services:
kafka:
image: ches/kafka
depends_on:
- zookeeper
environment:
# Use container hostname support of the default Compose network
ZOOKEEPER_IP: zookeeper
ports:
- '9092:9092' # Kafka broker
- '7203:7203' # JMX
volumes:
- kafka-data:/data
- kafka-logs:/logs
zookeeper:
image: zookeeper:3.4
restart: unless-stopped
ports:
- '2181:2181'
volumes:
kafka-data:
kafka-logs: This is probably compatible with the v2 file format also, I haven't tested. If this doesn't work, can you let me know more details about the problems you have for your use case? There can be some troublesome bits with mapped ports for Kafka using Docker on Mac or Windows, where there is technically still a VM running the Docker daemon under the covers but they try to magically abstract the mapping of ports to your localhost. It Just Works most of the time but Kafka in particular has some complications with it, related to advertised host name. All of that basically disappears if you can do everything within the Docker network and not map ports, but that certainly limits convenience for local development. |
That helps a bunch. Thank you! |
Hi @ches like you say I'm running into trouble with this approach using Docker on Mac. I can verify that things work within the docker network using the precanned producer/consumer examples, but I want to be able to point my java client (i.e. from the host machine) to the kafka running in the container, and that blows up. I've tried pointing my client at kafka:9092, localhost:9092, 0.0.0.0:9092, 127.0.0.1:9092.... Talking to just zookeeper seems to work (e.g. for topics). Any pointers on how to properly set this up? Thanks! |
Hey @ches I've tried this docker compose and I ran into some problems. I tried
I also tried accessing the machine using
to run
and the result was
Any ideas on how to help? |
Hello In an attempt to investigate I created a new docker-compose.yml with just zookeeper and kafka using new file space. When I run the producer/consumer test I get the same problem, here is some interaction and output; $ docker-compose ps
|
Sorry for seeking tech support, but I've looked around fairly extensively on how to this image up via docker compose, and haven't had much luck. Would you be able to add documentation to the README detailing a working setup with compose?
Here's my non-working configuration at the moment.
The text was updated successfully, but these errors were encountered: