与beeline相关的权限问题

wmvff8tz  于 2021-05-31  发布在  Hadoop
关注(0)|答案(0)|浏览(270)

问题

为什么我不能用用户连接到hiverserver2 ubuntu 但是由用户 hadoop 你没事吧?

简介

我创建了一个用户, hadoop ,在一台操作系统为ubuntu18.04.5lts的机器上作为namenode,并构建了一个具有4个worker的hadoop集群。

Hadoop 3.3.0
Source code repository https://gitbox.apache.org/repos/asf/hadoop.git -r aa96f1871bfd858f9bac59cf2a81ec470da649af
Compiled by brahma on 2020-07-06T18:44Z
Compiled with protoc 3.7.1
From source with checksum 5dc29b802d6ccd77b262ef9d04d19c4
This command was run using /opt/hadoop-3.3.0/share/hadoop/common/hadoop-common-3.3.0.jar

然后,我在集群上用服务器模式的derby构建了hive。

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-3.3.0/share/hadoop/common/lib/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]
Hive 3.1.2
Git git://HW13934/Users/gates/tmp/hive-branch-3.1/hive -r 8190d2be7b7165effa62bd21b7d60ef81fb0e4af
Compiled by gates on Thu Aug 22 15:01:18 PDT 2019
From source with checksum 0492c08f784b188c349f6afb1d8d9847

下面是我试图执行的。

$ beeline
beeline> !connect jdbc:hive2://master:10000 APP ${password}

当我被处决的时候 hadoop ,我得到了成功的消息。

Connecting to jdbc:hive2://master:10000
Connected to: Apache Hive (version 3.1.2)
Driver: Hive JDBC (version 3.1.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ

当我被处决的时候 ubuntu ,我收到了错误信息。

WARN jdbc.HiveConnection: Failed to connect to master:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://master:10000: 
Failed to open new session: java.lang.RuntimeException:
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): 
User: hadoop is not allowed to impersonate APP (state=08S01,code=0)

我试过修改 core-site.xml 以及 hive-site.xml 正如neeraj在authorizationexception中所说的:不允许用户冒充用户,但我仍然收到相同的错误消息。
这是我添加到 core-site.xml 以及 hive-site.xml .

<!--core-site.xml-->
<!--This addition is done in the master node and every worker-->
<property>
  <name>hadoop.proxyuser.hadoop.groups</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.hadoop.hosts</name>
  <value>*</value>
</property>
<!--hive-stie.xml-->
<property>
  <name>hive.server2.enable.doAs</name>
  <value>true</value>
  <description>Impersonate the connected user, default true.</description>
</property>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题