Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive permission denied for user anonymous using beeline shell

I created a 3 node Hadoop cluster with 1 namenode and 2 datanode.

I can perform a read/write query from Hive shell, but not beeline.

I found many suggestions and answers related to this issue.
In every suggestion it was mentioned to give the permission for the userX for each individual table.
But I don't know how to set the permission for an anonymous user once and for all.

Why I am getting the user anonymous while accessing the data from beeline or from a Java program?

I am able to read the data from the both beeline shell and using Java JDBC connection.
But I can't insert the data in the table.

This is my jdbc connection : jdbc:hive2://hadoop01:10000.

Below is the error i am getting while on insert request:

Permission denied: user=anonymous, access=WRITE, inode="/user/hive/warehouse/test_log/.hive-staging_hive_2017-10-07_06-54-36_347_6034469031019245441-1":hadoop:supergroup:drwxr-xr-x

like image 552
sachin Avatar asked Oct 06 '17 12:10

sachin


1 Answers

Beeline syntax is

beeline -n username -u "url"

I assume you are missing the username. Also, no one but the hadoop user has WRITE access to that table anyway

If you don't have full control over the table permissions, you can try relocating the staging directory with the setting hive.exec.stagingdir

like image 121
OneCricketeer Avatar answered Nov 15 '22 08:11

OneCricketeer