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