Hadoop Hbase访问被拒绝例外

问题描述 投票:0回答:1

我想访问已与Hbase表同步的凤凰表。我写了一些jdbc代码来访问Phoenix表中的数据,但是由于启用了护林员策略,我遇到了访问被拒绝的异常。

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)

“登陆”用户已被授予通过护林员执行所有任务的权限,但仍然收到错误消息,显示为“权限不足”。我想以“登陆”用户身份创建连接。在这里需要帮助

java jdbc hbase phoenix apache-ranger
1个回答
0
投票

根据您的错误消息,似乎是它正在尝试为您的用户“ saurav_bilung”而不是“着陆”用户进行身份验证。当您提交或运行代码时,您是否正在以“着陆”用户身份注册?另外,请确保您的用户和“登陆用户”有权访问SYSTEM.STATS表。让我知道怎么回事

© www.soinside.com 2019 - 2024. All rights reserved.