hadoop hbase访问被拒绝异常

hof1towb  于 2021-06-09  发布在  Hbase
关注(0)|答案(1)|浏览(597)

我想访问同步到hbase表的phoenix表。我编写了一些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");

我得到的错误消息如下:

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)

“登陆”用户已被授予通过ranger执行所有任务的权限,但我仍然收到错误消息“权限不足”。我想作为“登陆”用户创建连接。这里需要帮助吗

6qfn3psc

6qfn3psc1#

根据您的错误消息,它似乎是在尝试为您的用户“saurav\u bilung”而不是“landing”用户进行身份验证。当你提交或运行你的代码时,你是作为“登陆”用户吗?另外,确保您的用户和“landing”可以访问system.stats表。告诉我进展如何

相关问题