Support Questions
Find answers, ask questions, and share your expertise

Not able to reach HDP 2.5 from host

Hi all,

I'm using the HDP 2.5 running under VirtualBox in my Mac to work with Phoenix. I'm trying to write with my java code running on Intellij some dataframes in Phoenix but I'm obtaining always the next error:

17/01/11 16:56:54 INFO ZooKeeper: Initiating client connection, connectString=sandbox.hortonworks.com:2181 sessionTimeout=90000 watcher=hconnection-0x4b7ec1850x0, quorum=sandbox.hortonworks.com:2181, baseZNode=/hbase-unsecure
17/01/11 16:56:54 INFO ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
17/01/11 16:56:54 INFO ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
17/01/11 16:56:54 INFO ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x15988eb14b00079, negotiated timeout = 40000
17/01/11 16:57:43 INFO ConnectionManager$HConnectionImplementation: Closing zookeeper sessionid=0x15988eb14b00079
17/01/11 16:57:43 INFO ZooKeeper: Session: 0x15988eb14b00079 closed
17/01/11 16:57:43 INFO ClientCnxn: EventThread shut down
17/01/11 16:57:43 ERROR Executor: Exception in task 1.0 in stage 3.0 (TID 26)
java.sql.SQLException: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Wed Jan 11 16:57:43 CET 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=68466: row 'SYSTEM:CATALOG,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=localhost,16020,1484080823715, seqNum=0

    at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2432)
    at org.apache.phoenix.query.ConnectionQueryServicesImpl$13.call(ConnectionQueryServicesImpl.java:2352)
    at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
    

I was setting up HBase and Phoenix on the Sandbox with Ambari and following the steps of this tutorial:

http://hortonworks.com/hadoop-tutorial/bi-apache-phoenix-odbc/

Inside of the Sandbox everything is working properly. I was able to create tables in phoenix and load some data with the tutorial, HBase is working properly too.I was reading some posts from the community and I realised that the problem could come from the next situations:

-Hosts are not properly declared. -Ports 16000,16010,16020,16030 are closed.

-Classpath has to include /etc/hbase/conf

https://community.hortonworks.com/questions/14136/how-do-i-connect-to-hbase-on-sandbox-vm-from-host....

https://community.hortonworks.com/questions/14942/adding-sandboxhortonworkscom-to-etchosts-does-not....

therefore I made all this changes:

HOSTS SANDBOX:

127.0.0.1    localhost
::1    localhost ip6-localhost ip6-loopback
fe00::0    ip6-localnet
ff00::0    ip6-mcastprefix
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters
127.0.0.1    sandbox.hortonworks.com

(By default sandbox.hortonworks.com is 172.17.0.2 in this file but it didn't work either)

HOSTS HOST:

127.0.0.1    localhost sandbox.hortonworks.com
255.255.255.255    broadcasthost
::1             localhost
192.168.57.100 quickstart.cloudera # Kudu quickstart VM

CLASSPATH SANDBOX:

/etc/hbase/conf

the line in my code which is writting into Phoenix is the next:

bookingDF.write().format("org.apache.phoenix.spark").mode(SaveMode.Overwrite).options(ImmutableMap.of("table", "B","zkUrl", "sandbox.hortonworks.com:2181:/hbase-unsecure")).save();

After all this changes i continue obtaining the same error.Does anyone has an idea about something wrong in my configuration?

It would be so nice if you could give me any hint because I don't know what I'm doing wrong.

Thanks a lot!

12 REPLIES 12

Re: Not able to reach HDP 2.5 from host

Contributor

@daniel gerald orbegoso barrantes What is the value of "zookeeper.znode.parent" set to ?

Re: Not able to reach HDP 2.5 from host

@lrahejathe value of zookeeper.znode.parent is /hbase-unsecure.

<property> <name>zookeeper.znode.parent</name> <value>/hbase-unsecure</value> </property>

I read in other posts that it has to be /hbase , but inside of zookeeper I can't find /hbase, only /hbase-unsecure

Re: Not able to reach HDP 2.5 from host

@daniel gerald orbegoso barrantes

If HBase is not running in a Kerberized environment (unsecure), then you are correct that t should be /hbase-unsecure.

Re: Not able to reach HDP 2.5 from host

Explorer

Which version of Spark are you using? I assume when you say java code, you mean code running in spark.

From Josh Mahonin:

Spark 2.x isn't currently supported in a released Phoenix version, but is slated for the upcoming 4.10.0 release. If you'd like to compile your own version in the meantime, you can find the ticket/patch here:

https://issues.apache.org/jira/browse/PHOENIX-3333 or: https://github.com/apache/phoenix/commit/a0e5efcec5a1a732b2dce9794251242c3d66eea6

Re: Not able to reach HDP 2.5 from host

@wxuI'm using version 1.6 because I read that Phoenix is not supporting in the moment Spark 2.x, and yes when I say java code I mean my code running in spark. It is a code running in Intellij, written in Java. It creates dataframes with spark and stores this data in Phoenix as I showed before.

Re: Not able to reach HDP 2.5 from host

Super Collaborator

Are you using docker based sandbox running in VirtualBox?

In this case you need to perform following steps:

1. Expose data ports for master and region server. Edit /root/start_scripts/start_sandbox.sh and add

-p 16000:16000 \
-p 16020:16020 \

to the port maps section (you may add it before mapping for 16030 for example)

2. Now you need to rebuild and restart sandbox.

docker kill sandbox
docker rm sandbox
/root/start_scripts/start_sandbox.sh

3. Set up port forwarding in VirtualBox. Open Settings for Sandbox, switch to Network tab and click on Port Forwarding button. Add two new rules for ports 16000 and 16020 in the same way like it's done for other ports.

If you are using sandbox without docker, only step (3) is required.

And it's better to change value in /etc/hosts on Sandbox VM back to the original .

Re: Not able to reach HDP 2.5 from host

@Sergey Soldatov

I'm not using docker. I opened these ports 16000 and 16020 as I read in other posts that those ports have to be opened, but it didn't work neither. Even I'm able to connect with my browser the RegionServer with the port 16030.

11393-screen-shot-2017-01-13-at-104603.png

I will change the value of the hosts then again to 172.17.0.2 but I read in other post that it has to be 127.0.0.1. What is the difference?

Re: Not able to reach HDP 2.5 from host

@daniel gerald orbegoso barrantes

Are you using the HDP 2.5 Sandbox or did you build a single instance yourself? If you are using the VirtualBox version of the HDP 2.5 Sandbox, that still uses Docker so the steps that @Sergey Soldatov pointed out are accurate. The "Docker" version of the Sandbox is a pure Docker implementation that doesn't use VirtualBox or VMWare. However both VirtualBox and VMWare Sandboxes use Docker internally.

Re: Not able to reach HDP 2.5 from host

@Michael Young

thanks a lot for the answer. First of all I would like to apologise because of my inexpirience, I'm new working with Phoenix and with the Sandbox and I didn't know that the VirtualBox version of HDP 2.5 sandbox is using internally Docker. I followed the steps that @Sergey Soldatov suggested me, but now I'm obtaining the errors I wrote in the last post answering Sergey. Please it would be nice if you could take a look and give me any hint. It looks like the problem is with Zookeeper but inside of the Sandbox is working properly as I could check with Ambari. The second error says the next :

Outdated jars. The following servers require an updated phoenix.jar to 
be put in the classpath of HBase: 
region=SYSTEM.CATALOG,,1483454355052.79b335665d7ca00f1d4b5abeb1b5e4ea., 
hostname=sandbox.hortonworks.com,16020,1484566289679, seqNum=45

What I'm doing wrong or what I forgot?