您的位置:首页 > 其它

【Kafka】Troubleshooting

2016-01-15 00:00 246 查看
一、Kafka Failed to send messages after 3 tries

http://www.tuicool.com/articles/eeIvyy3

[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.connect

在ZK上找到broker的hostname。

1.配置生成者的/etc/hosts或是其他的,就是让ping ${hostname}

2.配置server.properties==>advertiesd.host.name=${ip}即把ip注册到ZK上,这样生产者就直接访问ip了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: