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

You should provide a valid username and password that has privileges to access the HDFS and Hive Services (user running HiveServer2). For your setup, the user in which Hadoop and Hive are installed would be the superuser.

These credentials will be used by beeline to initiate a connection with HiveServer2.

And, add these properties in 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

<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/%[email protected]%3E