Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Query a Secure HBase cluster through Phoenix In Java code #741

Open
scootli opened this issue Jul 30, 2015 · 2 comments
Open

Query a Secure HBase cluster through Phoenix In Java code #741

scootli opened this issue Jul 30, 2015 · 2 comments

Comments

@scootli
Copy link

scootli commented Jul 30, 2015

Our hadoop and hbase are secure by kerberos. I also see the #382. and The sqlline works(our version is phoenix-4.5.0-HBase-0.98-bin). My current problem is how I do in java code?
My current code are as following:
Connection cc = null;
Statement statement = null;
String rootPath = System.getProperty("user.dir");
System.setProperty("java.security.auth.login.config", rootPath + "/conf/zk-jaas.conf");
String driver = "org.apache.phoenix.jdbc.PhoenixDriver";
String url = "jdbc:phoenix:" + zkServer + ":" + zkPort;
try {
Class.forName(driver);
cc = DriverManager.getConnection(url);
statement = cc.createStatement();
} catch (Exception ex) {
ex.printStackTrace();
}

       and the hbase-site.xml is in the classpath.

But I got the error as follows on hbase master:
[RpcServer.reader=4,port=60000] ipc.RpcServer: RpcServer.listener,port=60000: count of bytes read: 0
org.apache.hadoop.hbase.security.AccessDeniedException: Authentication is required
at org.apache.hadoop.hbase.ipc.RpcServer$Connection.readAndProcess(RpcServer.java:1513)
at org.apache.hadoop.hbase.ipc.RpcServer$Listener.doRead(RpcServer.java:854)
at org.apache.hadoop.hbase.ipc.RpcServer$Listener$Reader.doRunLoop(RpcServer.java:645)
at org.apache.hadoop.hbase.ipc.RpcServer$Listener$Reader.run(RpcServer.java:620)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

How I can do with secure hbase in java code? Thanks.
It will be great if some one could share their thoughts

@jtaylor-sfdc
Copy link
Contributor

Hello,
This email list is no longer active. Please post your question on our
Apache mailing list here: http://phoenix.apache.org/mailing_list.html

On Thu, Jul 30, 2015 at 5:43 AM, scootli [email protected] wrote:

Our hadoop and hbase are secure by kerberos. I also see the #382
#382. and The sqlline
works(our version is phoenix-4.5.0-HBase-0.98-bin). My current problem is
how I do in java code?
My current code are as following:
Connection cc = null;
Statement statement = null;
String driver = "org.apache.phoenix.jdbc.PhoenixDriver";
String url = "jdbc:phoenix:" + zkServer + ":" + zkPort;
try {
Class.forName(driver);
cc = DriverManager.getConnection(url);
statement = cc.createStatement();
} catch (Exception ex) {
ex.printStackTrace();
}

But I got the error as follows on hbase master:
[RpcServer.reader=4,port=60000] ipc.RpcServer:
RpcServer.listener,port=60000: count of bytes read: 0
org.apache.hadoop.hbase.security.AccessDeniedException: Authentication is
required
at
org.apache.hadoop.hbase.ipc.RpcServer$Connection.readAndProcess(RpcServer.java:1513)
at
org.apache.hadoop.hbase.ipc.RpcServer$Listener.doRead(RpcServer.java:854)
at
org.apache.hadoop.hbase.ipc.RpcServer$Listener$Reader.doRunLoop(RpcServer.java:645)
at
org.apache.hadoop.hbase.ipc.RpcServer$Listener$Reader.run(RpcServer.java:620)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

How I can do with secure hbase in java code? Thanks.

It will be great if some one could share their thoughts


Reply to this email directly or view it on GitHub
#741.

@apathodia
Copy link

Hi scootli,

Did you get solution for this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants