That code can be traced down to:
public static String[] getHosts(String strInterface, String nameserver)
throws UnknownHostException {
String[] ips = getIPs(strInterface);
Vector<String> hosts = new Vector<String>();
for (int ctr = 0; ctr < ips.length; ctr++)
try {
hosts.add(reverseDns(InetAddress.getByName(ips[ctr]),
nameserver));
} catch (Exception e) {
}
if (hosts.size() == 0)
return new String[] { InetAddress.getLocalHost().getCanonicalHostName() };
else
return hosts.toArray(new String[] {});
}
nslookup on the IP returned nothing. I've confirmed that the reverse DNS
records are missing from the nameserver. So it defaults to the hostname.
----- Original Message -----
From: [email protected]
To: Sudarshan Kadambi (BLOOMBERG/ 731 LEXIN), [email protected]
At: Nov 15 2013 11:07:01
Hum. I don't know why I was not able to find it before. Sorry about that.
Have you tried to directly call reverseDns from a small java class on your
server to see what is returned?
2013/11/15 Sudarshan Kadambi (BLOOMBERG/ 731 LEXIN) <[email protected]>
Asaf:
What doesn't work is that the RegionServers bind to the IP that the hostname
maps to in /etc/hosts and not to the specified interface.
I've this in hbase-site.xml:
</property>
<property>
<name>hbase.master.dns.interface</name>
<value>eth0</value>
</property>
</property>
<property>
<name>hbase.regionserver.dns.interface</name>
<value>eth0</value>
</property>
This however has no effect. I'm on HBase 0.94.6.
I see:
// Server to handle client requests.
String hostname = conf.get("hbase.regionserver.ipc.address",
Strings.domainNamePointerToHostName(DNS.getDefaultHost(
conf.get("hbase.regionserver.dns.interface", "default"),
conf.get("hbase.regionserver.dns.nameserver", "default"))));
int port = conf.getInt(HConstants.REGIONSERVER_PORT,
HConstants.DEFAULT_REGIONSERVER_PORT);
// Creation of a HSA will force a resolve.
InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
if (initialIsa.getAddress() == null) {
throw new IllegalArgumentException("Failed resolve of " + initialIsa);
}
So this setting is in the code (that JIRA should be resolved; it's confusing).
Reverse DNS lookups don't work yet on my cluster. Could this be the reason? I
traced this down to a call to getHosts() which does a reverseDns lookup. And
since that doesn't work it falls back to the default?
----- Original Message -----
From: [email protected]
To: Sudarshan Kadambi (BLOOMBERG/ 731 LEXIN), [email protected]
At: Nov 15 2013 00:07:50
We are using both of the following properties:
hbase.regionserver.dns.interface, base.master.dns.interface. Both set to the
interface name we want. We have two interfaces as you described - one for inner
communication and one for external.
What exactly is not working for you?
On Wed, Nov 13, 2013 at 8:02 PM, Sudarshan Kadambi (BLOOMBERG/ 731 LEXIN)
<[email protected]> wrote:
Hi Guys:
I've HBase running on a machine with multiple interfaces (for in-bound and
inter-cluster traffic). I can't get HBase to listen on the interface I want it
to by setting hbase.regionserver.dns.interface. Does this setting work? What is
its purpose?
After reading an old thread on the user list, I wasn't sure:
http://comments.gmane.org/gmane.comp.java.hadoop.hbase.user/10150
That thread led me to this unresolved JIRA:
https://issues.apache.org/jira/browse/HBASE-2502
-sudarshan