版本升级以后hive catalog集成ranger的权限功能出现问题,导致所有hive catalog表不可查

Viewed 50

1、问题背景:2.0.13升级2.1.6,替换了lib和bin目录,升级之前该功能使用正常
2、查询sql:
SELECT * from hive_catalog.db.tablename;
3、catalog的创建信息如下:
CREATE CATALOG hive_catalog PROPERTIES (
"type" = "hms",
"specified_database_list" = "x",
"metadata_refresh_interval_sec" = "180",
"ipc.client.fallback-to-simple-auth-allowed" = "true",
"hive.version" = "3.1.0",
"hive.metastore.uris" = "thrift://x:9083",
"hadoop.username" = "hive",
"dfs.nameservices" = "x",
"dfs.namenode.rpc-address.x.nn2" = x:8020",
"dfs.namenode.rpc-address.x.nn1" = "x:8020",
"dfs.ha.namenodes.xx" = "nn1,nn2",
"dfs.client.failover.proxy.provider.x" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider",
"access_controller.properties.ranger.service.name" = "hive",
"access_controller.class" = "org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory"
);
4、具体报错如下:
大概是找不到这个类:org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory

2024-10-08 16:52:38,019 WARN (mysql-nio-pool-3|400) [StmtExecutor.executeByNereids():766] Nereids plan query failed:
/* ApplicationName=DBeaver 22.3.2 - SQLEditor <doris升级.sql> */ SELECT * from hive_catalog.edw.dwd__installbase__data__instance_mapping__nd
LIMIT 0, 200
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory
at org.apache.doris.mysql.privilege.AccessControllerManager.createAccessController(AccessControllerManager.java:107) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.datasource.ExternalCatalog.initAccessController(ExternalCatalog.java:335) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.lazyLoadCtlAccessController(AccessControllerManager.java:85) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.getAccessControllerOrDefault(AccessControllerManager.java:74) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.checkColumnsPriv(AccessControllerManager.java:179) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.analysis.UserAuthentication.checkPermission(UserAuthentication.java:69) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.CheckPrivileges.checkColumnPrivileges(CheckPrivileges.java:109) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.CheckPrivileges.visitLogicalRelation(CheckPrivileges.java:78) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.CheckPrivileges.visitLogicalRelation(CheckPrivileges.java:47) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.RelationVisitor.visitLogicalCatalogRelation(RelationVisitor.java:65) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.RelationVisitor.visitLogicalExternalRelation(RelationVisitor.java:99) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.RelationVisitor.visitLogicalFileScan(RelationVisitor.java:107) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.logical.LogicalFileScan.accept(LogicalFileScan.java:130) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.doPruneChild(ColumnPruning.java:398) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.pruneChildren(ColumnPruning.java:384) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.pruneChildren(ColumnPruning.java:354) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.visit(ColumnPruning.java:126) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.visit(ColumnPruning.java:82) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.PlanVisitor.visitLogicalProject(PlanVisitor.java:201) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.logical.LogicalProject.accept(LogicalProject.java:137) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.doPruneChild(ColumnPruning.java:398) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.pruneChildren(ColumnPruning.java:384) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.visit(ColumnPruning.java:142) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.visit(ColumnPruning.java:82) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.PlanVisitor.visitLogicalLimit(PlanVisitor.java:193) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.logical.LogicalLimit.accept(LogicalLimit.java:119) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.doPruneChild(ColumnPruning.java:398) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.pruneChildren(ColumnPruning.java:384) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.skipPruneThisAndFirstLevelChildren(ColumnPruning.java:251) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.visitLogicalSink(ColumnPruning.java:189) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.visitLogicalSink(ColumnPruning.java:82) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.SinkVisitor.visitLogicalResultSink(SinkVisitor.java:100) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.logical.LogicalResultSink.accept(LogicalResultSink.java:60) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.ColumnPruning.rewriteRoot(ColumnPruning.java:116) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.CheckPrivileges.rewriteRoot(CheckPrivileges.java:53) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.jobs.rewrite.CustomRewriteJob.execute(CustomRewriteJob.java:61) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.jobs.executor.AbstractBatchJobExecutor.execute(AbstractBatchJobExecutor.java:139) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.RewriteCteChildren.visit(RewriteCteChildren.java:73) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.RewriteCteChildren.visit(RewriteCteChildren.java:57) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.PlanVisitor.visitLogicalSink(PlanVisitor.java:121) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.visitor.SinkVisitor.visitLogicalResultSink(SinkVisitor.java:100) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.trees.plans.logical.LogicalResultSink.accept(LogicalResultSink.java:60) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.rules.rewrite.RewriteCteChildren.rewriteRoot(RewriteCteChildren.java:68) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.jobs.rewrite.CustomRewriteJob.execute(CustomRewriteJob.java:61) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.jobs.executor.AbstractBatchJobExecutor.execute(AbstractBatchJobExecutor.java:139) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.NereidsPlanner.lambda$rewrite$4(NereidsPlanner.java:308) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.NereidsPlanner.keepOrShowPlanProcess(NereidsPlanner.java:695) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.NereidsPlanner.rewrite(NereidsPlanner.java:308) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.NereidsPlanner.planWithoutLock(NereidsPlanner.java:234) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.NereidsPlanner.planWithLock(NereidsPlanner.java:199) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.nereids.NereidsPlanner.plan(NereidsPlanner.java:124) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.executeByNereids(StmtExecutor.java:760) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:545) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:521) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:323) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:206) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:272) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:300) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:358) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_191]
Caused by: java.lang.ClassNotFoundException: org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_191]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_191]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_191]
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_191]
at org.apache.doris.mysql.privilege.AccessControllerManager.createAccessController(AccessControllerManager.java:99) ~[doris-fe.jar:1.2-SNAPSHOT]
... 62 more
2024-10-08 16:52:38,023 WARN (mysql-nio-pool-3|400) [StmtExecutor.executeByLegacy():998] execute Exception. stmt[2229, 9dc3be29499d46a3-86332d517d1b00d8]
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory
at org.apache.doris.mysql.privilege.AccessControllerManager.createAccessController(AccessControllerManager.java:107) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.datasource.ExternalCatalog.initAccessController(ExternalCatalog.java:335) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.lazyLoadCtlAccessController(AccessControllerManager.java:85) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.getAccessControllerOrDefault(AccessControllerManager.java:74) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.checkTblPriv(AccessControllerManager.java:171) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.checkTblPriv(AccessControllerManager.java:166) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.privilege.AccessControllerManager.checkTblPriv(AccessControllerManager.java:158) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.analysis.SelectStmt.getTables(SelectStmt.java:420) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.analyze(StmtExecutor.java:1212) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.executeByLegacy(StmtExecutor.java:865) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:595) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:521) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.executeQuery(ConnectProcessor.java:323) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:206) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.handleQuery(MysqlConnectProcessor.java:272) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.dispatch(MysqlConnectProcessor.java:300) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.qe.MysqlConnectProcessor.processOnce(MysqlConnectProcessor.java:358) ~[doris-fe.jar:1.2-SNAPSHOT]
at org.apache.doris.mysql.ReadListener.lambda$handleEvent$0(ReadListener.java:52) ~[doris-fe.jar:1.2-SNAPSHOT]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_191]
Caused by: java.lang.ClassNotFoundException: org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_191]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_191]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_191]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_191]
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_191]
at org.apache.doris.mysql.privilege.AccessControllerManager.createAccessController(AccessControllerManager.java:99) ~[doris-fe.jar:1.2-SNAPSHOT]

1 Answers