我正在ubuntu16.04上运行hive2.1.1和hadoop2.7.3。 ps aux | grep hive
显示hiveserver2正在运行。
我正在尝试使用用户[hive2]和密码[password]通过beeline登录到hivesever2。
这是我的直线输出:
beeline> !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:
17/02/14 13:51:41 [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: server is not allowed to impersonate anonymous (state=08S01,code=0)
我可以通过输入 !connect jdbc:hive2://
成直线。
以下是my hive-site.xml:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true&useSSL=false</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>password</value>
</property>
<property>
<name>beeline.hs2.connection.user</name>
<value>hive2</value>
</property>
<property>
<name>beeline.hs2.connection.password</name>
<value>password</value>
</property>
<property>
<name>beeline.hs2.connection.hosts</name>
<value>localhost:10000</value>
</property>
</configuration>
我删除了beeline-hs2-connection.xml,以防它覆盖hive-site.xml。
这是我的core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.proxyuser.centos.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.centos.hosts</name>
<value>*</value>
</property>
</configuration>
如何修复错误并连接到jdbc:hive2://localhost:10000?
谢谢!
1条答案
按热度按时间j0pj023g1#
用户:不允许服务器模拟匿名
在这里
server
是试图模拟的用户anonymous
用户。将这些属性添加到
core-site.xml
然后重新启动服务。