- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
HBase : Zookeeper serves Internal IP to Remote client (Java API)
- Labels:
-
Apache HBase
-
Apache Zookeeper
Created on 05-05-2019 05:11 AM - edited 09-16-2022 07:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am running a very basic HBase connection program from a remote server.
Reading the server logs, I see Zookeeper acknowledge the request, but then serves to the Client the internal IP of HBase Master, which is of no use from the outside world.
I know where the master is and what its public IP is but I do not know how to effectively connect to HBase remotely using the Java API. Any Ideas ?
I've seen some people advice to mess up with the /etc/hosts file but that's an ugly and inelegant solution, and it breaks other parts of the ecosystem.
String zookeeperHost = "public.ip.address";
Configuration hconfig = HBaseConfiguration.create();
hconfig.set("hbase.zookeeper.quorum",zookeeperHost);
hconfig.set("hbase.zookeeper.property.clientPort", "2181");
hconfig.set("zookeeper.znode.parent", "/hbase-unsecure");
HBaseAdmin.available(hconfig);org.apache.hadoop.hbase.MasterNotRunningException:
com.google.protobuf.ServiceException:
java.net.UnknownHostException: unknown host: ip-xx-xx-xx-xx.eu-west-1.compute.internal
Created 05-08-2019 06:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That said, you can point HBase Master and RegionServer to use the address from a specific interface name (eth0, eth1, etc.) and/or a specific DNS resolver (IP or name that can answer to a dns:// resolving call) via advanced config properties:
hbase.master.dns.interface
hbase.master.dns.nameserver
hbase.regionserver.dns.interface
hbase.regionserver.dns.nameserver
By default the services will use whatever is the host's default name and resolving address: getent hosts $(hostname -f) and publish this to clients.