简体   繁体   English

无法使用直线连接到配置单元,用户 root 无法模拟匿名

[英]Cannot connect to hive using beeline, user root cannot impersonate anonymous

I'm trying to connect to hive using beeline !connect jdbc:hive2://localhost:10000 and I'm being asked for a username and password我正在尝试使用!connect jdbc:hive2://localhost:10000连接到 hive !connect jdbc:hive2://localhost:10000并且我被要求输入用户名和密码


Connecting to jdbc:hive2://localhost:10000' Enter username for jdbc:hive2://localhost:10000: Enter password for jdbc:hive2://localhost:10000:


As I don't know what username or password I'm supposed to type in I'm leaving it empty which causes the error: Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: root is not allowed to impersonate anonymous (state=,code=0) My setup is a single node hadoop cluster in ubuntu.因为我不知道我应该输入什么用户名或密码,所以我将其留空,这会导致错误: Error: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: root is not allowed to impersonate anonymous (state=,code=0)我的设置是 ubuntu 中的单节点 hadoop 集群。 I can confirm that the services are up and running, both hadoop and hiveserver2我可以确认服务已启动并正在运行,包括 hadoop 和 hiveserver2

The question is , what are these username and password I'm being asked, where can I find them or set them?问题是,我被问到的这些用户名和密码是什么,我在哪里可以找到它们或设置它们?

Thanks in advance提前致谢

You should provide a valid username and password that has privileges to access the HDFS and Hive Services ( user running HiveServer2).您应该提供一个有效的usernamepassword ,该usernamepassword有权访问 HDFS 和 Hive 服务(运行 HiveServer2 的user )。 For your setup, the user in which Hadoop and Hive are installed would be the superuser.为了您的设置中, user在其中安装Hadoop和配置单元将成为超级用户。

These credentials will be used by beeline to initiate a connection with HiveServer2.这些凭证将被用于beeline启动与HiveServer2的连接。

And, add these properties in core-site.xml并且,在core-site.xml添加这些属性

<property>
  <name>hadoop.proxyuser.username.groups</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.username.hosts</name>
  <value>*</value>
</property>

Restart services after adding these properties.添加这些属性后重新启动服务。

In hive-site.xml need to set the parameter hive.server2.enable.doAs to false在 hive-site.xml 中需要将参数 hive.server2.enable.doAs 设置为 false

<property>
<name>hive.server2.enable.doAs</name>
<value>FALSE</value>
<description>
Setting this property to true will have HiveServer2 execute
Hive operations as the user making the calls to it.
</description>
</property> 

http://mail-archives.apache.org/mod_mbox/hive-user/201602.mbox/%3C54b7754ceb8370b7250bba929369763f@cloudtechnologypartners.co.uk%3E http://mail-archives.apache.org/mod_mbox/hive-user/201602.mbox/%3C54b7754ceb8370b7250bba929369763f@cloudtechnologypartners.co.uk%3E

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM