启动hiveserver2服务:hive --service hiveserver2
启动beeline:/hive/bin/ beeline
启动连接:!connetc jdbc:hive2://hadoop01:10000/default
报错如下:
LF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10000/default
Enter username for jdbc:hive2://localhost:10000/default: root
Enter password for jdbc:hive2://localhost:10000/default: ******
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 root (state=,code=0)
报错原因:root用户不能被用来模仿自己
解决方案:修改hadoop的core-site.xml
加上下列部分:
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
重新启动机器