network reachability when using confluent images.
Opened this issue · 0 comments
Deleted user commented
Can we add environment variables exposing zookeeper and kafka host ip or other solutions to network reachability when using confluent images.
I am using the following
docker run -d --name zookeeper -p 127.0.0.1:2181:2181 --hostname zookeeper confluent/zookeeper
docker run -d --name kafka --hostname kafka -p 127.0.0.1:9092:9092 --link zookeeper:zookeeper \
--env KAFKA_LOG_CLEANUP_POLICY=compact confluent/kafka
Then use a the Sarama go client (using 127.0.0.1, 2181 and 9092 for zookeeper and kafka), in a docker container and get the following error
2015/08/12 01:34:27 subscription.go:113: creating consumer:
2015/08/12 01:36:20 server.go:1775: http: panic serving 127.0.0.1:55194: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
goroutine 12 [running]:
net/http.func·011()
/usr/src/go/src/net/http/server.go:1130 +0xbb
Can we introduce a KAFKA_ADVERTISED_HOST_NAME:, KAFKA_ADVERTISED_PORT: and similar for zookeeper.
These are what my mappings look like
macbook:src aartikumargupta$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01cb90eb8abf 019547acd204 "/bin/sh -c /program 21 hours ago Up About an hour 8080/tcp prickly_stallman1
70b61fb70de9 confluent/kafka "/bin/sh -c /kafka-d 21 hours ago Up About an hour 127.0.0.1:9092->9092/tcp kafka
4e5ff816657f confluent/zookeeper "/usr/local/bin/zk-d 21 hours ago Up About an hour 2888/tcp, 127.0.0.1:2181->2181/tcp, 3888/tcp zookeeper