Reply
New Contributor
Posts: 3
Registered: ‎03-02-2015

Apache phoenix cloudera cluster phoenix client zookeeper error

Hi,

 

I have Phoenix installed on a 5 node Cloudera cluster with 3 zookeeper nodes on AWS. I have put the phoenix server and client jars in the hbase class path on all nodes and restarted the cluster. The phoenix command line works on the cluster and running an executable JDBC jar on the cluster returns data.

 

When I run the JDBC program on my local machine I get the error below. I've read here that there is an issue on AWS where internal and external IPs were get confused and zookeeper can't connect to HBase properly.

 

http://stackoverflow.com/questions/28676561/apache-phoenix-jdbc-connection-zookeeper-error

 

I followed the solution below and it worked but modifying the config files on the cluster breaks it. 

 

The problem I was having is this:

 

  • App successfully connects to Zookeeper on 54.x.x.x
  • Zookeeper responds OK, and returns a 172.x.x.x IP address for

connecting to HBase

  • App then uses the IP given by Zookeeper and tries to connect to

HBase on 172.x.x.x

  • App connection fails with the error below

 

 

Isolved it with the following (repeat for each server in your

cluster):

 

  • Add aliases on local machine to

*C:\Windows\System32\Drivers\etc\hosts*

 

  • x.x.x box1

 

  • Add alias on cluster machine to */etc/hosts*
  • x.x.x box1

 

  • Change *hbase/conf/hbase-site.xml* on each server in cluster to

refer to everything by aliases:

 

  • <name>hbase.rootdir</name> <value>hdfs://box1:8020/myhb</value>

 

  • <name>hbase.zookeeper.quorum</name> <value>box1 </value>

 

(I have also changed *hadoop-2.6.0/etc/hadoop/core-site.xml* and

*hadoop-2.6.0/etc/hadoop/yarn-site.xml* to use these aliases as well, not

sure if it’s necessary but I did it for consistency).

 

Can anybody advise? 

 

Thanks

 

org.apache.phoenix.exception.PhoenixIOException: com.google.protobuf.ServiceException: java.net.UnknownHostException: unknown host: ip-172-31-0-212.eu-west-1.compute.internal
at org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:108)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:832)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1126)
at org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:110)
at org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1590)
at org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:568)
at org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:175)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:271)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:263)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:261)
at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1043)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1551)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1520)
at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1520)
at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)
at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:126)
at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:133)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at mysqljbdctest.PhoenixJDBC.main(PhoenixJDBC.java:22)

Expert Contributor
Posts: 101
Registered: ‎01-24-2014

Re: Apache phoenix cloudera cluster phoenix client zookeeper error

Unknown host exception is definately DNS resolution problems, which you can hack around with further host file entries. 

Looks like your node is registering in zookeeper as  "ip-172-31-0-212.eu-west-1.compute.internal" ?

you can confirm that by looking at the info in zookeeper with the zkcli.

 

 

Hope this helps!

 

-Ben

Announcements