当我尝试使用 hiverserver2 启动 Hive 时出现以下错误。
Connecting to jdbc:hive2://localhost:10000
18/10/25 09:45:38 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: deco is not allowed to impersonate anonymous (state=08S01,code=0)
我使用的用户名是deco。
我还在 core-site.xml 文件中添加了以下条目:
<property>
<name>hadoop.proxyuser.deco.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.deco.groups</name>
<value>*</value>
</property>
我仍然无法使用直线连接。我使用了以下命令:
$HIVE_HOME/bin/beeline -u jdbc:hive2://localhost:10000
和
$HIVE_HOME/bin/beeline -n $(whoami) -u jdbc:hive2://localhost:10000
我什至备份了 metastore_db 文件夹并使用以下命令重新启动:
$HIVE_HOME/bin/schematool -dbType derby -initSchema
我什至在 10001 端口上启动了 hiveserver2 并将直线连接到 10001,但仍然遇到同样的错误
以上都证明是徒劳的。
帮助我快死了
最佳答案
我曾经遇到过这个错误
User * is not allowed to impersonate anonymous
这是因为默认情况下 hive 尝试以调用用户身份执行操作,我在 hive 配置文件 conf/hive-site.xml 中添加以下行,要求 hive 作为 hiveserver2 进程用户执行操作,然后摆脱这个错误:
<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>
Impersonation
By default HiveServer2 performs the query processing as the user who submitted the query. But if the following parameter is set to false, the query will run as the user that the hiveserver2 process runs as.
hive.server2.enable.doAs – Impersonate the connected user, default true.
关于hadoop - 不允许用户冒充匿名 (state=08S01,code=0) org.apache.hadoop.security.authorize.AuthorizationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52994585/