We are using Kafka 0.9.0 on our dev setups. We see that the Kafka
configurations currently expose a way to configure the host.name and/or
advertised.host.name which state:
# Hostname the broker will bind to. If not set, the server will bind to
all interfaces
#host.name=
# 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>
The problem for us is that for our system where we use Kafka, we don't
use a DNS server and the IP allocation/assignment to the machine is via
DHCP. As a result we don't have a set DNS name nor know the IP address
before hand. However, we do know the network interface name to which we
want the Kafka server to be using. Would it be possible add a feature
where the config property could expose something like a
advertised.host.interface which takes the name of the network interface
which the Kafka server will use? Internally the implementation could
then use any of the IP addresses returned by
http://docs.oracle.com/javase/7/docs/api/java/net/NetworkInterface.html#getInterfaceAddresses%28%29
after looking up the NetworkInterface by name
http://docs.oracle.com/javase/7/docs/api/java/net/NetworkInterface.html#getByName%28java.lang.String%29
Is this something that could be added as an enhancement?
-Jaikiran