-- 创建catalogs (注意是加了hudi,ha,ranger,Kerberos)
CREATE CATALOG `ranger_hive_wzw` PROPERTIES (
"yarn.resourcemanager.principal" = "hive/datasophon01@HADOOP.COM",
"type" = "hms",
"ipc.client.fallback-to-simple-auth-allowed" = "true",
"hive.metastore.uris" = "thrift://ip:9083",
"hive.metastore.sasl.enabled" = "true",
"hive.metastore.kerberos.principal" = "hive/datasophon01@HADOOP.COM",
"hadoop.security.authentication" = "kerberos",
"hadoop.kerberos.principal" = "hive/datasophon01@HADOOP.COM",
"hadoop.kerberos.keytab" = "/etc/security/keytab/hive.service.keytab",
"dfs.nameservices" = "nameservice1",
"dfs.namenode.rpc-address.nameservice1.nn2" = "ip1:8020",
"dfs.namenode.rpc-address.nameservice1.nn1" = "ip2:8020",
"dfs.ha.namenodes.nameservice1" = "nn1,nn2",
"dfs.client.failover.proxy.provider.nameservice1" = "org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider",
"access_controller.properties.ranger.service.name" = "hive",
"access_controller.class" = "org.apache.doris.catalog.authorizer.RangerHiveAccessControllerFactory"
);
-- 查看 Catalog
show CATALOGS;
-- 切换 Catalog
SWITCH ranger_hive_wzw;
-- 查看 hive数据库
show DATABASES
-- 查看已创建的角色
SHOW ROLES;
-- 查看当前用户权限和角色
SHOW GRANTS;
-- 查看所有用户权限和角色
SHOW ALL GRANTS;
-- 创建用户
CREATE USER IF not EXISTS ranger_test IDENTIFIED BY '123456';
-- 授予指定库表的权限给用户,必须先加元数据库
GRANT SELECT_PRIV,ALTER_PRIV,LOAD_PRIV ON internal.information_schema.* TO 'ranger_test'@'%';
-- 授予指定库表的权限给用户
GRANT SELECT_PRIV,ALTER_PRIV,LOAD_PRIV ON internal.industrial_chain.ads_chain_industry_area_distribution TO 'ranger_test'@'%';
-- 撤权/撤销角色:
REVOKE
-- 配置ranger
-- ranger 增加用户
-- 查看
Doris连接hive外表&权限管理
最新推荐文章于 2024-07-23 08:00:00 发布