1、Kafka Failed to send messages after 3 triesjava
http://www.tuicool.com/articles/eeIvyy3 web
[zk: localhost:2181(CONNECTED) 5] get /brokers/ids/136 {"jmx_port":-1,"timestamp":"1452864687938","host":"hftest0001.webex.com","version":1,"port":9092} 按照default配置,broker啓動後,會把hostname註冊到zk上, # Hostname the broker will bind to. If not set, the server will bind to all interfaces #host.name=localhost # Hostname the broker will advertise to producers and consumers. If not set, it uses the # value for "host.name" if configured. Otherwise, it will use the value returned from # java.net.InetAddress.getCanonicalHostName(). #advertised.host.name=<hostname routable by clients>
當生產者向服務器發起鏈接,會再kafka的服務器上配置的zookeeper.connectshell
在ZK上找到broker的hostname。服務器
1.配置生成者的/etc/hosts或是其餘的,就是讓ping ${hostname}ui
2.配置server.properties==>advertiesd.host.name=${ip}即把ip註冊到ZK上,這樣生產者就直接訪問ip了。.net