karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 3cky <...@git.apache.org>
Subject [GitHub] karaf-cellar pull request: Avoid reverse DNS lookups if cluster me...
Date Thu, 03 Sep 2015 10:38:00 GMT
GitHub user 3cky opened a pull request:


    Avoid reverse DNS lookups if cluster member hostname is literal IP address

    Now, Cellar `HazelcastNode` class constructor uses `member.getInetSocketAddress().getHostName()`
for host name and ID. As noted in `InetSocketAddress` class docs, `getHostName()` method may
trigger a name service reverse lookup if the address was created with a literal IP address.
In some environments (like Kubernetes) this lead to problem with nodes identification because
no cluster-wide DNS or PTR records are available for reverse lookups, but local IP could be
resolvable using /etc/hostname file provided by cluster manager.
    In proposed patch, if member address was created with a literal IP address, `getHostName()`
method is not called and IP address string representation is used as member host name.
    Ideally, we should use `InetSocketAddress.getHostString()` method, but it is available
only since Java 1.7, so in 1.6 only way to get host identity without reverse DNS lookups is
rather ugly set of checks involving output of `InetSocketAddress.toString()`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/3cky/karaf-cellar hazelcast-node-id

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #13
commit 1f0d402fbfcbbba9733f063673a4e01fd513d8b1
Author: Victor Antonovich <v.antonovich@gmail.com>
Date:   2015-09-02T16:24:26Z

    Fixed HazelcastNode host/ID initializing for unresolved IP addresses


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message