阿里云emr集群hive开启ranger后执行set时报错“java.lang.IllegalArgumentException: Cannot modify mapred.job.queue.name at runtime. It is not in list of params that are allowed to be modified at runtime”
网上搜这个报错搜到华为云的一篇文章
https://support.huaweicloud.com/trouble-mrs/mrs_03_0149.html
里面提到一个解决方案是设置hive.security.whitelist.switch为OFF,因为配置hive.security.authorization.sqlstd.confwhitelist担心会有遗漏,毕竟改配置要重启hive,所以优先考虑了这个方案,不过在阿里云的测试环境配置后发现hiveserver2启动失败了,报错信息为
ERROR [HiveServer2-Handler-Pool: Thread-48] server.TThreadPoolServer: Error occurred during processing of message.
java.lang.RuntimeException: org.apache.thrift.transport.TSaslTransportException: No data or no sasl data in the stream
at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219) ~[hive-exec-2.3.3.jar:2.3.3]
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:269) ~[hive-exec-2.3.3.jar:2.3.3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: org.apache.thrift.transport.TSaslTransportException: No data or no sasl data in the stream
at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:328) ~[hive-exec-2.3.3.jar:2.3.3]
at org.apache.thrift.transport.TSaslServerTransport.open(TSaslServerTransport.java:41) ~[hive-exec-2.3.3.jar:2.3.3]
at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:216) ~[hive-exec-2.3.3.jar:2.3.3]
... 4 more
后来参考了这篇文章https://blog.csdn.net/qq475781638/article/details/90241719
去掉了hive.security.whitelist.switch这个配置,将hive.security.authorization.sqlstd.confwhitelist与hive.security.authorization.sqlstd.confwhitelist.append做了几个通配来保证覆盖的比较全,对应值为
mapred.*|hive.*|mapreduce.*|spark.*|odps.*|QUERY.*|query.*|QUERY_TIMEOUT_S
配置后重启hive,再用set配置相关参数后就不再报错了