Open thuylevn opened 4 years ago
Using docker toolbox, after run $ docker network create kafka-net
$ docker run -d --name zookeeper --network kafka-net zookeeper:3.4 $ docker run -d --name kafka --network kafka-net --env ZOOKEEPER_IP=zookeeper ches/kafka
$ docker run --rm --network kafka-net ches/kafka \
kafka-topics.sh --create --topic test --replication-factor 1 --partitions 1 --zookeeper zookeeper:2181 Created topic "test".
$ docker run --rm --interactive --network kafka-net ches/kafka \
kafka-console-producer.sh --topic test --broker-list kafka:9092
kafka-console-consumer.sh --topic test --from-beginning --bootstrap-server kafka:9092
Cannot connect to Kafka brocker http://192.168.99.100/9092
Any suggestions?
Change your third command.
docker run -d --name kafka --network kafka-net --env ZOOKEEPER_IP=zookeeper --env KAFKA_ADVERTISED_HOST_NAME=kafka ches/kafka
Using docker toolbox, after run $ docker network create kafka-net
$ docker run -d --name zookeeper --network kafka-net zookeeper:3.4 $ docker run -d --name kafka --network kafka-net --env ZOOKEEPER_IP=zookeeper ches/kafka
$ docker run --rm --network kafka-net ches/kafka \
In separate terminals:
$ docker run --rm --interactive --network kafka-net ches/kafka \
$ docker run --rm --network kafka-net ches/kafka \
Cannot connect to Kafka brocker http://192.168.99.100/9092
Any suggestions?