简体   繁体   中英

Hbase node could not be reached from Hbase java api client

I'm trying to connect to an hbase cluster using the java api. The api is connecting to the zookeeper after that is trying to connect to a cluster node. But this time fails with this error:

INFO ipc.HBaseRPC: Server at <server-name>/<ip>:60020 could not be reached after 1 tries, giving up.

The port in the node is open because is default open by the hbase. I'm using the default settings for hbase. The node is set as regional server. I've try using the standalone configuration for hbase and is working the difference is the port that the api is connecting after zookeeper which is not the same.

I had the same problem when I configured the cluser using cloudera Manager.

The solution is: remove the 127.0.0.1 entry from the /etc/hosts file.

If you are connecting to a remote HBase cluster - make sure to add all of cluster hostnames and ip's to your local hosts file (/etc/hosts on Linux or C:\\Windows\\System32\\drivers\\etc\\hosts on Windows), like in the following example:

192.168.150.101 vm01.domain.com

192.168.150.102 vm02.domain.com

192.168.150.103 vm03.domain.com

192.168.150.104 vm04.domain.com

Apparently Zookeper uses hostname instead of ip somewhere when trying to connect to HBase and it can be a problem when connecting remotely with Java.

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM