简体   繁体   English

Hadoop Hbase 访问被拒绝异常

[英]Hadoop Hbase Access denied exception

I want to access phoenix tables which is synced to Hbase tables.我想访问同步到 Hbase 表的凤凰表。 I wrote some jdbc code to access the data from Phoenix tables but i am getting access denied exception because of ranger policies enabled.我编写了一些 jdbc 代码来访问 Phoenix 表中的数据,但是由于启用了 Ranger 策略,我收到了访问被拒绝的异常。

Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
Connection conn = DriverManager.getConnection(
                "jdbc:phoenix:abc1,abc2,abc3:2181:/hbase-unsecure","landing", "password");
System.out.println("Got connection !!!");
ResultSet rst = conn.createStatement().executeQuery("select * from EMP");

I get the error message as :我收到错误消息:

org.apache.hadoop.hbase.security.AccessDeniedException: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions for user ‘saurav_bilung',action: scannerOpen, tableName:SYSTEM.STATS, family:0, column: GUIDE_POSTS_ROW_COUNT
    at org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor.authorizeAccess(RangerAuthorizationCoprocessor.java:521)
    at org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor.preScannerOpen(RangerAuthorizationCoprocessor.java:911)
    at org.apache.ranger.authorization.hbase.RangerAuthorizationCoprocessor.preScannerOpen(RangerAuthorizationCoprocessor.java:855)
    at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$50.call(RegionCoprocessorHost.java:1267)
    at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost$RegionOperation.call(RegionCoprocessorHost.java:1660)
    at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperation(RegionCoprocessorHost.java:1734)
    at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.execOperationWithResult(RegionCoprocessorHost.java:1709)
    at org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.preScannerOpen(RegionCoprocessorHost.java:1262)
    at org.apache.hadoop.hbase.regionserver.RSRpcServices.scan(RSRpcServices.java:2352)
    at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32385)
    at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2141)
    at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:112)
    at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:187)
    at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:167)

"landing" user has been given permission to perform all tasks through ranger but still I get error message as "insufficient privileges". “登陆”用户已被授予通过 Ranger 执行所有任务的权限,但我仍然收到“权限不足”的错误消息。 I want to create connection as "landing" user.我想以“登陆”用户的身份创建连接。 Need help here在这里需要帮助

As per your error message, it seems to be that it's trying to authenticate for your user "saurav_bilung" instead of the "landing" user.根据您的错误消息,它似乎正在尝试为您的用户“saurav_bilung”而不是“登陆”用户进行身份验证。 When you spark-submit or run your code, are you sudo-ing as the "landing" user?当您提交或运行代码时,您是否以“登陆”用户身份执行 sudo 操作? Also, make sure that your user and "landing" have access to the SYSTEM.STATS table.另外,请确保您的用户和“登陆”可以访问 SYSTEM.STATS 表。 Let me know how that goes让我知道这是怎么回事

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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