1.基于多租户及kerberos认证的CDP 环境
手工在hive中设置队列名称:set tez.queue.name=root.sjzt.sjzt;
然后执行SQL语句报错:
0: jdbc:hive2://huajcdp1.cdp.com:2181,huajcdp> set tez.queue.name=root.sjzt.sjzt;
No rows affected (0.025 seconds)
0: jdbc:hive2://huajcdp1.cdp.com:2181,huajcdp> select count(1) from ods_uf2otc_secumshare;
INFO : Compiling command(queryId=hive_20230227144737_9914f065-346c-4cd9-a560-4e4363971e04): select count(1) from ods_uf2otc_secumshare
INFO : Semantic Analysis Completed (retrial = false)
INFO : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:_c0, type:bigint, comment:null)], properties:null)
INFO : Completed compiling command(queryId=hive_20230227144737_9914f065-346c-4cd9-a560-4e4363971e04); Time taken: 0.207 seconds
INFO : Executing command(queryId=hive_20230227144737_9914f065-346c-4cd9-a560-4e4363971e04): select count(1) from ods_uf2otc_secumshare
INFO : Query ID = hive_20230227144737_9914f065-346c-4cd9-a560-4e4363971e04
INFO : Total jobs = 1
INFO : Launching Job 1 out of 1
INFO : Starting task [Stage-1:MAPRED] in serial mode
WARN : The session: sessionId=7e57c95e-41f5-496a-91a7-03bbfd826093, queueName=root.sjzt, user=hive, doAs=false, isOpen=false, isDefault=false has not been opened
INFO : Subscribed to counters: [] for queryId: hive_20230227144737_9914f065-346c-4cd9-a560-4e4363971e04
INFO : Tez session hasn't been created yet. Opening session
ERROR : Failed to execute tez graph.
org.apache.tez.dag.api.TezException: org.apache.hadoop.yarn.exceptions.YarnException: Failed to submit application_1677048109712_0048 to YARN : Application application_1677048109712_0048 submission by user : hive to specified queue : root.sjzt.sjzt is prohibited. Verify automatic queue mapping for user exists in yarn.scheduler.capacity.queue-mappings
at org.apache.tez.client.TezClient.start(TezClient.java:410) ~[tez-api-0.9.1.7.1.7.1000-141.jar:0.9.1.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.startSessionAndContainers(TezSessionState.java:547) ~[hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.openInternal(TezSessionState.java:385) ~[hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.tez.TezSessionState.open(TezSessionState.java:300) ~[hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolSession.open(TezSessionPoolSession.java:106) ~[hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.tez.TezTask.ensureSessionHasResources(TezTask.java:403) ~[hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.tez.TezTask.execute(TezTask.java:213) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:213) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:105) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Executor.launchTask(Executor.java:357) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Executor.launchTasks(Executor.java:330) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Executor.runTasks(Executor.java:246) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Executor.execute(Executor.java:109) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:749) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:504) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:498) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:166) [hive-exec-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:226) [hive-service-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hive.service.cli.operation.SQLOperation.access$700(SQLOperation.java:88) [hive-service-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:327) [hive-service-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_232]
at javax.security.auth.Subject.doAs(Subject.java:422) [?:1.8.0_232]
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1898) [hadoop-common-3.1.1.7.1.7.1000-141.jar:?]
at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:345) [hive-service-3.1.3000.7.1.7.1000-141.jar:3.1.3000.7.1.7.1000-141]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: org.apache.hadoop.yarn.exceptions.YarnException: Failed to submit application_1677048109712_0048 to YARN : Application application_1677048109712_0048 submission by user : hive to specified queue : root.sjzt.sjzt is prohibited. Verify automatic queue mapping for user exists in yarn.scheduler.capacity.queue-mappings
at org.apache.hadoop.yarn.client.api.impl.YarnClientImpl.submitApplication(YarnClientImpl.java:346) ~[hadoop-yarn-client-3.1.1.7.1.7.1000-141.jar:?]
at org.apache.tez.client.TezYarnClient.submitApplication(TezYarnClient.java:77) ~[tez-api-0.9.1.7.1.7.1000-141.jar:0.9.1.7.1.7.1000-141]
at org.apache.tez.client.TezClient.start(TezClient.java:405) ~[tez-api-0.9.1.7.1.7.1000-141.jar:0.9.1.7.1.7.1000-141]
... 30 more
ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask
INFO : Completed executing command(queryId=hive_20230227144737_9914f065-346c-4cd9-a560-4e4363971e04); Time taken: 5.735 seconds
INFO : OK
Error: Error while compiling statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask (state=08S01,code=1)
Caused by: org.apache.hadoop.yarn.exceptions.YarnException: Failed to submit application_1677048109712_0048 to YARN :
Application application_1677048109712_0048 submission by user :
hive to specified queue : root.sjzt.sjzt is prohibited.
Verify automatic queue mapping for user exists in yarn.scheduler.capacity.queue-mappings
意思是:不允许在hive 里面执行: set tez.queue.name=root.qmfx; 设置队列。
队列是通过已经存在的用户自动映射的。比如sjzt用户会使用root.sjzt 队列。
手工设置就会报错。
总结。
kinit -kt qmfx.keytab qmfx.@CDP.COM
hive 登录:不用设置队列名称。直接执行SQL默认会使用root.qmfx这个对接。