kafka-docker
kafka-docker copied to clipboard
Update tutorial
Here is a master ticket to track all the required tutorial updates, rather than having multiple tickets open tracking separate bits of information
To update
- [ ] Identify that
KAFKA_ADVERTISED_HOST
must be routable from host / bridge network. (https://github.com/wurstmeister/kafka-docker/issues/110) - [ ] Link to connectivity guide
- [ ] Document
--from-beginning
console parameter (https://github.com/wurstmeister/kafka-docker/issues/219) - [ ] Document
--bootstrap-server
option for new consumers (https://github.com/wurstmeister/kafka-docker/issues/243) - [ ] Enumerate difference between docker-machine + docker-for-mac
- [ ] Highlight cloning the repository first
- [ ] document any differences in versions for the
scale
/--scale
commands
Tipp:
This command throws 2 errors. --zookeeper
is not recognized and --bootstrap-server
is missing.
$ $KAFKA_HOME/bin/kafka-console-consumer.sh --topic=topic --zookeeper=$ZK
This line works for me:
$KAFKA_HOME/bin/kafka-console-consumer.sh --bootstrap-server `broker-list.sh` --topic topic --from-beginning
For security, do not mount the /var/run/docker.sock configuration file into the container.
https://github.com/wurstmeister/kafka-docker/issues/403#issuecomment-448555550
https://www.lvh.io/posts/dont-expose-the-docker-socket-not-even-to-a-container.html
Now that markdown -> site generation has been fixed by https://github.com/wurstmeister/kafka-docker/pull/454, these updates should be possible.
Follow up on https://github.com/wurstmeister/kafka-docker/issues/110 for MacOS.
Until you explicitly add --net kafka-docker_default
to the start-kafka-shell.sh
script, the internal docker DNS resolution for host zookeeper
won't work, so further examples about producer/consumer cannot be run.
The correct script should look like this:
#!/bin/bash
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --net kafka-docker_default -e HOST_IP=$1 -e ZK=$2 -i -t wurstmeister/kafka /bin/bash