CDH大数据平台 17Cloudera Manager Console之Sentry权限hive测试(markdown新版)

Posted 与自己作战

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CDH大数据平台 17Cloudera Manager Console之Sentry权限hive测试(markdown新版)相关的知识,希望对你有一定的参考价值。

💖个人主页:@与自己作战
💯作者简介:CSDN@博客专家CSDN@大数据领域优质创作者CSDN@内容合伙人阿里云@专家博主
🆘希望大佬们多多支持,携手共进
📝 如果文章对你有帮助的话,欢迎评论💬点赞👍收藏📂加关注
如需要支持请私信我💯必支持

文章目录

一、hive权限测试

1、beeline连接测试(2种连接方式自选)

beeline
!connect jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM

beeline -u ‘jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM’

[hadoop@cdh-client-v01 ~]$ beeline
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/jars/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/jars/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 2.1.1-cdh6.3.2 by Apache Hive
beeline> !connect jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM
Connecting to jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM
Connected to: Apache Hive (version 2.1.1-cdh6.3.2)
Driver: Hive JDBC (version 2.1.1-cdh6.3.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> show databases;
INFO  : Compiling command(queryId=hive_20221016092444_3fcb44fc-8223-4947-9f02-2b6a257a4e00): show databases
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO  : Completed compiling command(queryId=hive_20221016092444_3fcb44fc-8223-4947-9f02-2b6a257a4e00); Time taken: 0.161 seconds
INFO  : Executing command(queryId=hive_20221016092444_3fcb44fc-8223-4947-9f02-2b6a257a4e00): show databases
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016092444_3fcb44fc-8223-4947-9f02-2b6a257a4e00); Time taken: 0.051 seconds
INFO  : OK
+----------------+
| database_name  |
+----------------+
| default        |
+----------------+
1 row selected (0.323 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> 

2、创建角色用户

create role admin;
create role sentry_r;
grant all on server server1 to role admin;
grant role admin to group hive;
grant role admin to group hadoop;

0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create role admin;
INFO  : Compiling command(queryId=hive_20221016201150_d59e483c-1539-4000-8604-4b253dec4f4a): create role admin
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016201150_d59e483c-1539-4000-8604-4b253dec4f4a); Time taken: 0.041 seconds
INFO  : Executing command(queryId=hive_20221016201150_d59e483c-1539-4000-8604-4b253dec4f4a): create role admin
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016201150_d59e483c-1539-4000-8604-4b253dec4f4a); Time taken: 0.065 seconds
INFO  : OK
No rows affected (0.119 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create role sentry_r;
INFO  : Compiling command(queryId=hive_20221016201150_904d2f55-b4dd-4b99-8fc1-08e22269c3b7): create role sentry_r
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016201150_904d2f55-b4dd-4b99-8fc1-08e22269c3b7); Time taken: 0.031 seconds
INFO  : Executing command(queryId=hive_20221016201150_904d2f55-b4dd-4b99-8fc1-08e22269c3b7): create role sentry_r
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016201150_904d2f55-b4dd-4b99-8fc1-08e22269c3b7); Time taken: 0.011 seconds
INFO  : OK
No rows affected (0.053 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> grant all on server server1 to role admin;
INFO  : Compiling command(queryId=hive_20221016201150_05899b9f-2363-4383-aaea-4eddb3da1afb): grant all on server server1 to role admin
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016201150_05899b9f-2363-4383-aaea-4eddb3da1afb); Time taken: 0.033 seconds
INFO  : Executing command(queryId=hive_20221016201150_05899b9f-2363-4383-aaea-4eddb3da1afb): grant all on server server1 to role admin
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016201150_05899b9f-2363-4383-aaea-4eddb3da1afb); Time taken: 0.061 seconds
INFO  : OK
No rows affected (0.109 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> grant role admin to group hive;
INFO  : Compiling command(queryId=hive_20221016201401_0ae13477-a881-407e-8dab-59f8e709df8e): grant role admin to group hive
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016201401_0ae13477-a881-407e-8dab-59f8e709df8e); Time taken: 0.033 seconds
INFO  : Executing command(queryId=hive_20221016201401_0ae13477-a881-407e-8dab-59f8e709df8e): grant role admin to group hive
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016201401_0ae13477-a881-407e-8dab-59f8e709df8e); Time taken: 0.052 seconds
INFO  : OK
No rows affected (0.099 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> grant role admin to group hadoop;
INFO  : Compiling command(queryId=hive_20221016201402_61f4a265-8208-4f3c-8a3a-92eaa7ae8398): grant role admin to group hadoop
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016201402_61f4a265-8208-4f3c-8a3a-92eaa7ae8398); Time taken: 0.03 seconds
INFO  : Executing command(queryId=hive_20221016201402_61f4a265-8208-4f3c-8a3a-92eaa7ae8398): grant role admin to group hadoop
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016201402_61f4a265-8208-4f3c-8a3a-92eaa7ae8398); Time taken: 0.018 seconds
INFO  : OK
No rows affected (0.059 seconds)

3、创建数据库

create database etl;
create database bigdata;

0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create database etl;
INFO  : Compiling command(queryId=hive_20221016201415_6fbbf074-396d-4855-b9c5-473e0b329f91): create database etl
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016201415_6fbbf074-396d-4855-b9c5-473e0b329f91); Time taken: 0.071 seconds
INFO  : Executing command(queryId=hive_20221016201415_6fbbf074-396d-4855-b9c5-473e0b329f91): create database etl
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016201415_6fbbf074-396d-4855-b9c5-473e0b329f91); Time taken: 0.58 seconds
INFO  : OK
No rows affected (0.662 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create database bigdata;
INFO  : Compiling command(queryId=hive_20221016202415_1c3c8b90-7a9a-4bc4-b014-a7d4d6907bc7): create database bigdata
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016202415_1c3c8b90-7a9a-4bc4-b014-a7d4d6907bc7); Time taken: 0.064 seconds
INFO  : Executing command(queryId=hive_20221016202415_1c3c8b90-7a9a-4bc4-b014-a7d4d6907bc7): create database bigdata
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016202415_1c3c8b90-7a9a-4bc4-b014-a7d4d6907bc7); Time taken: 0.356 seconds
INFO  : OK
No rows affected (0.432 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> show databases;
INFO  : Compiling command(queryId=hive_20221016202720_e938507c-c437-45e6-94f0-8a2bc007d7d5): show databases
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO  : Completed compiling command(queryId=hive_20221016202720_e938507c-c437-45e6-94f0-8a2bc007d7d5); Time taken: 0.032 seconds
INFO  : Executing command(queryId=hive_20221016202720_e938507c-c437-45e6-94f0-8a2bc007d7d5): show databases
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016202720_e938507c-c437-45e6-94f0-8a2bc007d7d5); Time taken: 0.039 seconds
INFO  : OK
+----------------+
| database_name  |
+----------------+
| bigdata        |
| default        |
| etl            |
+----------------+
5 rows selected (0.103 seconds)

4、赋予对应权限

alter database etl set owner user etl;
alter database bigdata set owner user bigdata;

0: jdbc:hive2://cdh-master-v01.yunes.com:1000> alter database etl set owner user etl; 
INFO  : Compiling command(queryId=hive_20221016202428_654fb4a7-f2b7-4fc9-addd-afe65858c3d7): alter database etl set owner user etl
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016202428_654fb4a7-f2b7-4fc9-addd-afe65858c3d7); Time taken: 0.066 seconds
INFO  : Executing command(queryId=hive_20221016202428_654fb4a7-f2b7-4fc9-addd-afe65858c3d7): alter database etl set owner user etl
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016202428_654fb4a7-f2b7-4fc9-addd-afe65858c3d7); Time taken: 0.549 seconds
INFO  : OK
No rows affected (0.624 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> alter database bigdata set owner user bigdata;
INFO  : Compiling command(queryId=hive_20221016202428_97e41e05-373d-4745-87b7-e194a6e21835): alter database bigdata set owner user bigdata
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016202428_97e41e05-373d-4745-87b7-e194a6e21835); Time taken: 0.062 seconds
INFO  : Executing command(queryId=hive_20221016202428_97e41e05-373d-4745-87b7-e194a6e21835): alter database bigdata set owner user bigdata
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016202428_97e41e05-373d-4745-87b7-e194a6e21835); Time taken: 0.406 seconds
INFO  : OK
No rows affected (0.478 seconds)

5、创建数据库相关角色

create role etl;
create role etl_r;
create role bigdata;
create role bigdata_r;
create role hue_r;

0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create role etl; 
INFO  : Compiling command(queryId=hive_20221016203525_541dfbc9-d7eb-42dd-b430-23d10d270943): create role etl
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016203525_541dfbc9-d7eb-42dd-b430-23d10d270943); Time taken: 0.03 seconds
INFO  : Executing command(queryId=hive_20221016203525_541dfbc9-d7eb-42dd-b430-23d10d270943): create role etl
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016203525_541dfbc9-d7eb-42dd-b430-23d10d270943); Time taken: 0.016 seconds
INFO  : OK
No rows affected (0.057 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create role etl_r;
INFO  : Compiling command(queryId=hive_20221016203525_4c64ba55-159a-4c12-8536-a551b217b1e7): create role etl_r
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016203525_4c64ba55-159a-4c12-8536-a551b217b1e7); Time taken: 0.037 seconds
INFO  : Executing command(queryId=hive_20221016203525_4c64ba55-159a-4c12-8536-a551b217b1e7): create role etl_r
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016203525_4c64ba55-159a-4c12-8536-a551b217b1e7); Time taken: 0.011 seconds
INFO  : OK
No rows affected (0.058 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create role bigdata; 
INFO  : Compiling command(queryId=hive_20221016203525_f6261ba2-764e-43f0-ae10-1dd63e7dad15): create role bigdata
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016203525_f6261ba2-764e-43f0-ae10-1dd63e7dad15); Time taken: 0.031 seconds
INFO  : Executing command(queryId=hive_20221016203525_f6261ba2-764e-43f0-ae10-1dd63e7dad15): create role bigdata
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016203525_f6261ba2-764e-43f0-ae10-1dd63e7dad15); Time taken: 0.01 seconds
INFO  : OK
No rows affected (0.05 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create role bigdata_r;
INFO  : Compiling command(queryId=hive_20221016203526_cd0e4fa4-43ae-43bc-ac22-e726213596e5): create role bigdata_r
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016203526_cd0e4fa4-43ae-43bc-ac22-e726213596e5); Time taken: 0.031 seconds
INFO  : Executing command(queryId=hive_20221016203526_cd0e4fa4-43ae-43bc-ac22-e726213596e5): create role bigdata_r
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016203526_cd0e4fa4-43ae-43bc-ac22-e726213596e5); Time taken: 0.014 seconds
INFO  : OK
No rows affected (0.054 seconds)

6、级联授权

GRANT SELECT ON DATABASE etl TO ROLE etl_r WITH GRANT OPTION;
GRANT SELECT ON DATABASE bigdata TO ROLE bigdata_r WITH GRANT OPTION;
GRANT SELECT ON DATABASE bigdata TO ROLE hue_r WITH GRANT OPTION;
GRANT SELECT ON DATABASE bigdata TO ROLE sentry_r WITH GRANT OPTION;
GRANT ALL ON DATABASE etl TO ROLE etl WITH GRANT OPTION;
GRANT ALL ON DATABASE bigdata TO ROLE bigdata WITH GRANT OPTION;

0: jdbc:hive2://cdh-master-v01.yunes.com:1000> GRANT SELECT ON DATABASE etl TO ROLE etl_r WITH GRANT OPTION;GRANT SELECT ON DATABASE bigdata TO ROLE bigdata_r WITH GRANT OPTION;GRANT SELECT ON DATABASE bigdata TO ROLE hue_r WITH GRANT OPTION;GRANT SELECT ON DATABASE bigdata TO ROLE sentry_r WITH GRANT OPTION;GRANT ALL ON DATABASE etl TO ROLE etl WITH GRANT OPTION;GRANT ALL ON DATABASE bigdata TO ROLE bigdata WITH GRANT OPTION;
INFO  : Compiling command(queryId=hive_20221016204924_5cf1436c-57eb-43ae-b2a4-340f8b2533c8): GRANT SELECT ON DATABASE etl TO ROLE etl_r WITH GRANT OPTION
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016204924_5cf1436c-57eb-43ae-b2a4-340f8b2533c8); Time taken: 0.035 seconds
INFO  : Executing command(queryId=hive_20221016204924_5cf1436c-57eb-43ae-b2a4-340f8b2533c8): GRANT SELECT ON DATABASE etl TO ROLE etl_r WITH GRANT OPTION
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016204924_5cf1436c-57eb-43ae-b2a4-340f8b2533c8); Time taken: 0.022 seconds
INFO  : OK
No rows affected (0.065 seconds)
INFO  : Compiling command(queryId=hive_20221016204924_30c271bf-2d36-43b5-9599-77e7f8ef3fd8): GRANT SELECT ON DATABASE bigdata TO ROLE bigdata_r WITH GRANT OPTION
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016204924_30c271bf-2d36-43b5-9599-77e7f8ef3fd8); Time taken: 0.035 seconds
INFO  : Executing command(queryId=hive_20221016204924_30c271bf-2d36-43b5-9599-77e7f8ef3fd8): GRANT SELECT ON DATABASE bigdata TO ROLE bigdata_r WITH GRANT OPTION
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016204924_30c271bf-2d36-43b5-9599-77e7f8ef3fd8); Time taken: 0.02 seconds
INFO  : OK
No rows affected (0.067 seconds)
INFO  : Compiling command(queryId=hive_20221016204924_9ed7d981-acda-4cff-bec3-aee215403ba8): GRANT SELECT ON DATABASE bigdata TO ROLE hue_r WITH GRANT OPTION
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016204924_9ed7d981-acda-4cff-bec3-aee215403ba8); Time taken: 0.031 seconds
INFO  : Executing command(queryId=hive_20221016204924_9ed7d981-acda-4cff-bec3-aee215403ba8): GRANT SELECT ON DATABASE bigdata TO ROLE hue_r WITH GRANT OPTION
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016204924_9ed7d981-acda-4cff-bec3-aee215403ba8); Time taken: 0.014 seconds
INFO  : OK
No rows affected (0.056 seconds)
INFO  : Compiling command(queryId=hive_20221016204924_f28301e8-3c7b-477a-88b8-bc07b045dae3): GRANT SELECT ON DATABASE bigdata TO ROLE sentry_r WITH GRANT OPTION
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016204924_f28301e8-3c7b-477a-88b8-bc07b045dae3); Time taken: 0.034 seconds
INFO  : Executing command(queryId=hive_20221016204924_f28301e8-3c7b-477a-88b8-bc07b045dae3): GRANT SELECT ON DATABASE bigdata TO ROLE sentry_r WITH GRANT OPTION
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016204924_f28301e8-3c7b-477a-88b8-bc07b045dae3); Time taken: 0.015 seconds
INFO  : OK
No rows affected (0.057 seconds)
INFO  : Compiling command(queryId=hive_20221016204924_d47d678a-d704-4430-8362-1f1e8003d3ae): GRANT ALL ON DATABASE etl TO ROLE etl WITH GRANT OPTION
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016204924_d47d678a-d704-4430-8362-1f1e8003d3ae); Time taken: 0.028 seconds
INFO  : Executing command(queryId=hive_20221016204924_d47d678a-d704-4430-8362-1f1e8003d3ae): GRANT ALL ON DATABASE etl TO ROLE etl WITH GRANT OPTION
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016204924_d47d678a-d704-4430-8362-1f1e8003d3ae); Time taken: 0.013 seconds
INFO  : OK
No rows affected (0.053 seconds)
INFO  : Compiling command(queryId=hive_20221016204924_ce14204e-f09b-4b32-bef2-2ccb5f14ee4b): GRANT ALL ON DATABASE bigdata TO ROLE bigdata WITH GRANT OPTION
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016204924_ce14204e-f09b-4b32-bef2-2ccb5f14ee4b); Time taken: 0.035 seconds
INFO  : Executing command(queryId=hive_20221016204924_ce14204e-f09b-4b32-bef2-2ccb5f14ee4b): GRANT ALL ON DATABASE bigdata TO ROLE bigdata WITH GRANT OPTION
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016204924_ce14204e-f09b-4b32-bef2-2ccb5f14ee4b); Time taken: 0.012 seconds
INFO  : OK
No rows affected (0.057 seconds)

7、测试

kinit -kt H O M E / s e c u r i t y / k e y t a b s / HOME/security/keytabs/ HOME/security/keytabs/USER.keytab $USER
beeline -u ‘jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM’

[etl@cdh-client-v01 ~]$ kinit -kt $HOME/security/keytabs/$USER.keytab $USER
[etl@cdh-client-v01 ~]$ beeline -u 'jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM'
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/jars/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/jars/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://cdh-master-v01.yunes.com:10000/default;principal=hive/cdh-master-v01.yunes.com@YUNES.COM
Connected to: Apache Hive (version 2.1.1-cdh6.3.2)
Driver: Hive JDBC (version 2.1.1-cdh6.3.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 2.1.1-cdh6.3.2 by Apache Hive
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> show databases;
INFO  : Compiling command(queryId=hive_20221016210327_90f0316d-df7f-4e0e-bd6d-1e5e0e45fe6c): show databases
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO  : Completed compiling command(queryId=hive_20221016210327_90f0316d-df7f-4e0e-bd6d-1e5e0e45fe6c); Time taken: 0.158 seconds
INFO  : Executing command(queryId=hive_20221016210327_90f0316d-df7f-4e0e-bd6d-1e5e0e45fe6c): show databases
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016210327_90f0316d-df7f-4e0e-bd6d-1e5e0e45fe6c); Time taken: 0.069 seconds
INFO  : OK
+----------------+
| database_name  |
+----------------+
| default        |
| etl            |
+----------------+
2 rows selected (0.301 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> use etl;
INFO  : Compiling command(queryId=hive_20221016211548_73479c57-930d-408c-a308-873141aa90bd): use etl
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016211548_73479c57-930d-408c-a308-873141aa90bd); Time taken: 0.055 seconds
INFO  : Executing command(queryId=hive_20221016211548_73479c57-930d-408c-a308-873141aa90bd): use etl
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016211548_73479c57-930d-408c-a308-873141aa90bd); Time taken: 0.009 seconds
INFO  : OK
No rows affected (0.072 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> create table test(id int,name varchar(30));
INFO  : Compiling command(queryId=hive_20221016211608_062a8d4a-84ac-42c6-8ea6-f567d803941b): create table test(id int,name varchar(30))
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=hive_20221016211608_062a8d4a-84ac-42c6-8ea6-f567d803941b); Time taken: 0.053 seconds
INFO  : Executing command(queryId=hive_20221016211608_062a8d4a-84ac-42c6-8ea6-f567d803941b): create table test(id int,name varchar(30))
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=hive_20221016211608_062a8d4a-84ac-42c6-8ea6-f567d803941b); Time taken: 0.506 seconds
INFO  : OK
No rows affected (0.583 seconds)
0: jdbc:hive2://cdh-master-v01.yunes.com:1000> insert into test(id,name) values(1,'tian');
INFO  : Compiling command(queryId=hive_20221016211627_1b49cc04-eaea-42e0-8d3a-6320b1a579de): insert into test(id,name) values(1,'tian')
INFO  : Semantic Analysis Completed
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:_col0, type:int, comment:null), FieldSchema(name:_col1, type:varchar(30), comment:null)], properties:null)
INFO  : Completed compiling command(queryId=hive_20221016211627_1b49cc04-eaea-42e0-8d3a-6320b1a579de); Time taken: 0.528 seconds
INFO  : Executing command(queryId=hive_20221016211627_1b49cc04-eaea-42e0-8d3a-6320b1a579de): insert into test(id,name) values(1,'tian')
WARN  : 
INFO  : Query ID = hive_20221016211627_1b49cc04-eaea-42e0-8d3a-6320b1a579de
INFO  : Total jobs = 3
INFO  : Launching Job 1 out of 3
INFO  : Starting task [Stage-1:MAPRED] in serial mode
INFO  : Number of reduce tasks is set to 0 since there's no reduce operator
INFO  : number of splits:1
INFO  : Submitting tokens for job: job_1665818567571_0001
INFO  : Executing with tokens: [Kind: HDFS_DELEGATION_TOKEN, Service: ha-hdfs:TLQCluster, Ident: (token for hive: HDFS_DELEGATION_TOKEN owner=hive/cdh-master-v01.yunes.com@YUNES.COM, renewer=yarn, realUser=, issueDate=1665926188072, maxDate=1666530988072, sequenceNumber=1, masterKeyId=29)]
INFO  : The url to track the job: http://cdh-master-v02.yunes.com:8088/proxy/application_1665818567571_0001/
INFO  : Starting Job = job_1665818567571_0001, Tracking URL = http://cdh-master-v02.yunes.com:8088/proxy/application_1665818567571_0001/
INFO  : Kill Command = /opt/cloudera/parcels/CDH-6.3.2-1.cdh6.3.2.p0.1605554/lib/hadoop/bin/hadoop job  -kill job_1665818567571_0001
INFO  : Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
INFO  : 2022-10-16 21:16:42,246 Stage-1 map = 0%,  reduce = 0%
INFO  : 2022-10-16 21:16:52,567 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 1.94 sec
INFO  : MapReduce Total cumulative CPU time: 1 seconds 940 msec
INFO  : Ended Job = job_1665818567571_0001
INFO  : Starting task [Stage-7:CONDITIONAL] in serial mode
INFO  : Stage-4 is selected by condition resolver.
INFO  : Stage-3 is filtered out by condition resolver.
INFO  : Stage-5 is filtered out by condition resolver.
INFO  : Starting task [Stage-4:MOVE] in serial mode
INFO  : Moving data to directory hdfs://TLQCluster/user/hive/warehouse/etl.db/test/.hive-staging_hive_2022-10-16_21-16-27_063_238233700528644009-3/-ext-10000 from hdfs://TLQCluster/user/hive/warehouse/etl.db/test/.hive-staging_hive_2022-10-16_21-16-27_063_238233700528644009-3/CDH大数据平台 26Cloudera Manager Console之sqoopazkaban调度作业实战(markdown新版)

CDH大数据平台 19Cloudera Manager Console之azkaban安装编译配置(markdown新版)

CDH大数据平台 18Cloudera Manager Console之Sentry权限kafka测试(markdown新版)

CDH大数据平台 31Cloudera Manager Console之impala hive负载均衡(markdown新版)

CDH大数据平台 30Cloudera Manager Console之superset之redisldap配置(markdown新版四)

CDH大数据平台 29Cloudera Manager Console之superset之MySQL元数据配置(markdown新版三)