I have a 3-node setup where each kafka/zookeeper node has two network interfaces - one globally routeable (10.x.x.x) and one internal (192.168.x.x). I would like the kafka nodes to use the internal interface to talk to its neighboring brokers (faster and more efficient) and use the globally routeable 10.x address while connecting to producers and consumers.
Relevant portions of the config files are below: zookeeper.properties server.1=192.168.1.201:2888:3888 server.2=192.168.1.202:2888:3888 server.3=192.168.1.203:2888:3888 server.properties zookeeper.connect=192.168.1.201:2181,192.168.1.202:2181,192.168.1.203:2181 # Hostname of broker. If this is set, it will only bind to this address. If this is not set, it will bind to all interfaces, and publish one to ZK. host.name=10.a.b.c # 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=10.a.b.c This setup is using the 10.x.x.x address to talk to the other kafka brokers. If i were to unset the host.name property how do I know which IP address it will use and which one will it publish to ZK? Is there a different way to achieve this? Thanks. Mayank.
