You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Adrian Preston (JIRA)" <ji...@apache.org> on 2015/03/19 14:37:38 UTC

[jira] [Commented] (KAFKA-1715) better advertising of the bound and working interface

    [ https://issues.apache.org/jira/browse/KAFKA-1715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14369322#comment-14369322 ] 

Adrian Preston commented on KAFKA-1715:
---------------------------------------

Hi [~joestein], I found this bug via the 'newbie' label - and so I hope you don't mind if (as a newbie) I ask for a bit of advice on how best to resolve the problem.

To confirm my understanding: it sounds like there are situations where a broker can advertise a hostname in ZooKeeper that resolves to an address which isn't reachable by clients and/or the other brokers in the cluster?  Looking at the code (in KafkaHealthcheck) it appears that the hostname supplied to ZooKeeper is either:
# taken from the 'advertised.host.name' property,
# taken from the 'host.name' property, or
# as a last resort, obtained by calling InetAddress.getLocalHost.getCanonicalHostName.

For situations where a user has specified the 'advertised.host.name' or 'host.name' properties, I think the user must take on the remedial work of updating server.properties with new values.  So the question I've been pondering is: "is there a better way to pick a default than calling InetAddress.getLocalHost.getCanonicalHostName?" - and I don't think there is.  The Java network libraries provide the ability to enumerate local addresses and query various attributes of an address (e.g. "is this a loopback address?" - but I can't think of a heuristic that is a guaranteed improvement.  More over, I'd be worried that anything I did come up with would introduce "exciting" new failure modes - when it encountered an obscure network configuration.

Thus the best resolution I can come up with is to log the hostname advertised in ZooKeeper - so that this information is easily accessible to anyone troubleshooting a connectivity problem.  Optionally Kafka could also log a warning if Java reports that this hostname resolves to a loopback address.

What do you think?

> better advertising of the bound and working interface
> -----------------------------------------------------
>
>                 Key: KAFKA-1715
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1715
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Joe Stein
>              Labels: newbie
>             Fix For: 0.8.3
>
>
> As part of the auto discovery of brokers and meta data messaging we should try to advertise the interface that is bound and working better. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)