我已經構建了一個kafka碼頭集裝箱並使用碼頭構成進行編排。與碼頭主機外部的kafka碼頭集裝箱相互作用
調用docker ps
我得到以下putput:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5bde6f76246e hieutrtr/docker-kafka:0.0.1 "/start.sh" About an hour ago Up About an hour 7203/tcp, 0.0.0.0:32884->9092/tcp dockerkafka_kafka_3
be354f1b8cc0 hieutrtr/docker-ubuntu:devel "/usr/bin/supervisor About an hour ago Up About an hour 22/tcp producer1
50d3203af90e hieutrtr/docker-kafka:0.0.1 "/start.sh" About an hour ago Up About an hour 7203/tcp, 0.0.0.0:32883->9092/tcp dockerkafka_kafka_2
61b285f39615 hieutrtr/docker-kafka:0.0.1 "/start.sh" 2 hours ago Up 2 hours 7203/tcp, 0.0.0.0:32882->9092/tcp dockerkafka_kafka_1
20c9c5ccec05 jplock/zookeeper:3.4.6 "/opt/zookeeper/bin/ 2 hours ago Up 2 hours 2888/tcp, 3888/tcp, 0.0.0.0:32881->2181/tcp dockerkafka_zookeeper_1
我可以運行一個生產者和從泊塢窗容器內的消費者,但它不是從泊塢窗網絡之外的工作。
例如:
我在我的本地運行卡夫卡生產者和出現以下錯誤:
$ kafka_2.9.1-0.8.2.1: bin/kafka-console-producer.sh --topic test --broker-list $DOCKER_HOST:32884
[2015-08-31 06:55:15,450] WARN Property topic is not valid (kafka.utils.VerifiableProperties)
to
[2015-08-31 06:55:20,214] WARN Failed to send producer request with correlation id 2 to broker 1 with data for partitions [test,0] (kafka.producer.async.DefaultEventHandler)
java.nio.channels.ClosedChannelException
at kafka.network.BlockingChannel.send(BlockingChannel.scala:100)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:73)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:72)
at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(SyncProducer.scala:103)
at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply(SyncProducer.scala:103)
at kafka.producer.SyncProducer$$anonfun$send$1$$anonfun$apply$mcV$sp$1.apply(SyncProducer.scala:103)
This is my kafka docker example on github,其中包括提到的問題。
那麼,有沒有人遇到同樣的問題,可以以任何方式幫助我?
附加信息:
(從CHES /卡夫卡就叉和修改的東西泊塢窗-撰寫):
我認爲這不是問題。因爲我仍然從我的本地主機創建主題。有什麼關於java.rmi ....? –
這對我來說非常類似的症狀。我可以創建來自本地主機或其他容器的主題,但不發佈任何消息,直到我設置'advertised.host.name' – Lundahl
我們應該把什麼作爲advertised.host.name?面對同樣的問題 –