<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Unable to connect to hbase with phoenix in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208138#M69057</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/14200/asirna.html" nodeid="14200"&gt;@Aditya Sirna&lt;/A&gt; it's working now using (hbase client, phoenix jars and zookeeper jars. I get them from the hdp directories and I added the hbase_site.xml an core-site.xml in the classpath).&lt;/P&gt;&lt;P&gt;About the url:&lt;/P&gt;&lt;P&gt;"jdbc:phoenix:localhost:2181:/hbase:/keytab/ISMAEL.keytab:ISMAEL@MOCK"&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Ismael&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 00:52:37 GMT</pubDate>
    <dc:creator>Ismael</dc:creator>
    <dc:date>2017-10-10T00:52:37Z</dc:date>
    <item>
      <title>Unable to connect to hbase with phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208134#M69053</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I followed some tutorials with adding hbase client jar and phoenix client jar, and I'm not to connect and execute my query. Can anyone give me some leeds.&lt;/P&gt;&lt;P&gt;import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Test {
public static void main(String[] args) throws SQLException {
// Statement stmt = null;
ResultSet rset = null;
try {
Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
} catch (ClassNotFoundException e1) {
System.out.println("Exception Loading Driver");
e1.printStackTrace();
}
try {
Connection con = DriverManager.getConnection("jdbc:phoenix:localhost:2181:/hbase-unsecure");
// Connection con =
// DriverManager.getConnection("jdbc:phoenix:localhost:/hbase-unsecure:./keytab/ISMAEL.keytab:ISMAEL@MOCK");
// stmt = con.createStatement();
//
// stmt.executeUpdate("create table test (mykey integer not null
// primary key, mycolumn varchar)");
// stmt.executeUpdate("upsert into test values (1,'Hello')");
// stmt.executeUpdate("upsert into test values (2,'World!')");
// con.commit();
PreparedStatement statement = con.prepareStatement("select * from dsp_paas:toto");
rset = statement.executeQuery();
while (rset.next()) {
System.out.println(rset.getString("cf1"));
}
statement.close();
con.close();
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
} &lt;/P&gt;&lt;P&gt;I have this error message when I execute my code. &lt;/P&gt;&lt;P&gt;SLF4J: See &lt;A href="http://www.slf4j.org/codes.html#multiple_bindings" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/A&gt; for an explanation.
log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See &lt;A href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" target="_blank"&gt;http://logging.apache.org/log4j/1.2/faq.html#noconfig&lt;/A&gt; for more info.
java.lang.RuntimeException: java.lang.NullPointerException
java.sql.SQLException: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2482)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2389)
at org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:76)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:2389)
at org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:255)
at org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:150)
at org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at com.edf.dp.phoenix.Test.main(Test.java:24)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:218)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:327)
at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:302)
at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:167)
at org.apache.hadoop.hbase.client.ClientScanner.&amp;lt;init&amp;gt;(ClientScanner.java:162)
at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:797)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:602)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:403)
at org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:2417)
... 9 more
Caused by: java.lang.NullPointerException
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.getMetaReplicaNodes(ZooKeeperWatcher.java:463)
at org.apache.hadoop.hbase.zookeeper.MetaTableLocator.blockUntilAvailable(MetaTableLocator.java:561)
at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getMetaRegionLocation(ZooKeeperRegistry.java:61)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateMeta(ConnectionManager.java:1186)
at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1153)
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:300)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:156)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:210)
... 18 more&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 16:22:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208134#M69053</guid>
      <dc:creator>Ismael</dc:creator>
      <dc:date>2017-10-05T16:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to hbase with phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208135#M69054</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/9480/iboumedien.html" nodeid="9480"&gt;@Ismael Boumedien&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Is the cluster kerberized ? If yes, then the connection string should be "jdbc:phoenix:localhost:2181:/hbase-secure:&amp;lt;keytab path&amp;gt;:&amp;lt;principal&amp;gt;"&lt;/P&gt;&lt;P&gt;ex: "jdbc:phoenix:localhost:2181:/hbase-secure:/keytab/ISMAEL.keytab:ISMAEL@MOCK"&lt;/P&gt;&lt;P&gt;In the commented code , I see that you were using /hbase-unsecure.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 17:56:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208135#M69054</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2017-10-05T17:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to hbase with phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208136#M69055</link>
      <description>&lt;P&gt;Hi&lt;A href="https://community.hortonworks.com/users/14200/asirna.html"&gt; &lt;/A&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14200/asirna.html" nodeid="14200"&gt;@Aditya Sirna&lt;/A&gt;Aditya &lt;/P&gt;&lt;P&gt;Thanks for the replay I confirm the cluster is kerberized that's why I tried the two ways with the keytab and without. I still have the same issue.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Ismael&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 18:18:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208136#M69055</guid>
      <dc:creator>Ismael</dc:creator>
      <dc:date>2017-10-05T18:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to hbase with phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208137#M69056</link>
      <description>&lt;P&gt;HI &lt;A rel="user" href="https://community.cloudera.com/users/9480/iboumedien.html" nodeid="9480"&gt;@Ismael Boumedien&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I am sure that you are using /hbase-secure and not /hbase-unsecure. Can you please check if the zookeeper is active on localhost&lt;/P&gt;&lt;PRE&gt;netstat -tupln | grep 2181&lt;/PRE&gt;&lt;P&gt;Can you try passing all the zookeeper quorum nodes. &amp;lt;zk1:2181&amp;gt;,&amp;lt;zk2:2181&amp;gt;.. &lt;/P&gt;&lt;P&gt;Also, can you check if you are able to connect to phoenix using some client (ex : sqlline etc)&lt;/P&gt;&lt;PRE&gt;cd /usr/hdp/current/phoenix-client/bin/
./sqlline.py localhost:2181:/hbase-secure&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 18:23:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208137#M69056</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2017-10-05T18:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to hbase with phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208138#M69057</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/14200/asirna.html" nodeid="14200"&gt;@Aditya Sirna&lt;/A&gt; it's working now using (hbase client, phoenix jars and zookeeper jars. I get them from the hdp directories and I added the hbase_site.xml an core-site.xml in the classpath).&lt;/P&gt;&lt;P&gt;About the url:&lt;/P&gt;&lt;P&gt;"jdbc:phoenix:localhost:2181:/hbase:/keytab/ISMAEL.keytab:ISMAEL@MOCK"&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Ismael&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 00:52:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208138#M69057</guid>
      <dc:creator>Ismael</dc:creator>
      <dc:date>2017-10-10T00:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to connect to hbase with phoenix</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208139#M69058</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/9480/iboumedien.html" nodeid="9480"&gt;@Ismael Boumedien&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Glad that its working for you. Can you please accept the solution. This will be helpful for the community to find the correct answer easily.&lt;/P&gt;&lt;P&gt;-Aditya&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:42:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-connect-to-hbase-with-phoenix/m-p/208139#M69058</guid>
      <dc:creator>asirna</dc:creator>
      <dc:date>2017-10-10T11:42:40Z</dc:date>
    </item>
  </channel>
</rss>

