sachin
sachin

Reputation: 379

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

Upvotes: 6

Views: 6407

Answers (3)

Sai Shrikar Gembali
Sai Shrikar Gembali

Reputation: 1

You need to create the following hdfs directory:/user/hive/warehouse/test_log to get rid of the above error.

Upvotes: 0

sai harsha vardhan
sai harsha vardhan

Reputation: 72

If no database is specified in the connection URL to connect, like

jdbc:hive2://hadoop01:10000/default

then beeline connects to the database DEFAULT , and while inserting the data into the table - first the data is loaded to a temporary table in default database and then loaded to the actual table.

So, you need to give the user access to the DEFAULT database also, or you can connect to the databases where you have access to.

jdbc:hive2://hadoop01:10000/your_db

Upvotes: 0

OneCricketeer
OneCricketeer

Reputation: 191743

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

Upvotes: 10

Related Questions