Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission Denied error while creating database in hive

Tags:

hadoop

I am trying to database in hive, but when I run below query in HIVE:

CREATE DATABASE BIGDATA;

I receive the following error message:

FAILED: Error in metadata: MetaException(message:Got exception: org.apache.hadoop.security.AccessControlException org.apache.hadoop.security.AccessControlException: Permission denied: user=aseema, access=WRITE, inode="":hduser:supergroup:rwxr-xr-x) FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

What is causing this?

like image 778
Ronak Avatar asked Nov 18 '25 07:11

Ronak


2 Answers

This is because of the lack of permission to the user aseema in hdfs. Follow the steps below.

Login as hduser and perform the following operations (from the logs, it seems hduser is a superuser)

hadoop fs -mkdir -p /user/hive/warehouse
hadoop fs -mkdir /tmp
hadoop fs -chmod -R 777 /user/hive
hadoop fs -chmod 777 /tmp

After this, try executing the create database statement from aseema user.

like image 154
Amal G Jose Avatar answered Nov 21 '25 09:11

Amal G Jose


If you are running from Local Mode then you should run this command from hdfs user:

su hdfs

Then change the permission like below if you want:

hdfs dfs -chown -R <username_of_new_owner> /user
like image 27
Jegan Avatar answered Nov 21 '25 10:11

Jegan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!