hive2中使用beeline:
beeline -u jdbc:hive2://localhost:10000
启动报如下错误:Required field 'serverProtocolVersion' is unset!User: hadoop is not allowed to impersonate anonymous
解决方法:
hadoop的core-site.xml中添加如下配置:
<!--
Required field 'serverProtocolVersion' is unset!
User: hadoop is not allowed to impersonate anonymous
-->
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>hadoop</value>
<description>Allow the superuser oozie to impersonate any members of the group group1 and group2</description>
</property>
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>192.168.127.200,127.0.0.1,localhost</value>
<description>The superuser can connect only from host1 and host2 to impersonate a user</description>
</property>
然后使用如下命令启动:
beeline -u jdbc:hive2://localhost:10000 -n hadoop -p hadoop