在虛擬機(jī)搭建了kafka集群,在集群內(nèi)使用Shell可以成功發(fā)送消息創(chuàng)建Topic对竣。
但是在外部使用API無法發(fā)送消息庇楞,但是能創(chuàng)建topic
具體原因
Hostname and port the broker will advertise to producers and consumers. If not set, it uses the value for “l(fā)isteners” if configured. Otherwise, it will use the value returned from java.net.InetAddress.getCanonicalHostName().
解決方法:
advertised.listeners=PLAINTEXT://192.168.84.136:9092