Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Missing /user/admin directory on sandbox

avatar

Just started using a Hortonworks sandbox on Azure, no previous experience. Started going through the 'How to process data with Apache Hive' tutorial...one of the first steps is to upload files to /user/admin. It doesn't exist. I am not able to create the admin directory under /user because the add directory option is greyed out. Instead I create a new directory under /tmp and successfully uploaded the files. However I get to loading the data into the table:

LOAD DATA INPATH '/tmp/admin/Batting.csv' OVERWRITE INTO TABLE temp_batting;

and get :

INFO : Loading data to table default.temp_batting from hdfs://sandbox.hortonworks.com:8020/tmp/admin/Batting.csv ERROR : Failed with exception Unable to move source hdfs://sandbox.hortonworks.com:8020/tmp/admin/Batting.csv to destination hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/temp_batting/Batting.csv org.apache.hadoop.hive.ql.metadata.HiveException: Unable to move source hdfs://sandbox.hortonworks.com:8020/tmp/admin/Batting.csv to destination

.

Caused by: org.apache.hadoop.security.AccessControlException: Permission denied: user=hive, access=WRITE, inode="/tmp/admin/Batting.csv":admin:hdfs:drwxr-xr-x

Obviously a permissions error, but how do I change them, and how can I create /user/admin for future use?

Thanks.

1 ACCEPTED SOLUTION

avatar

@Adrian Savory

See the following:https://community.hortonworks.com/questions/7739/permission-denied-and-no-such-file-or-directory.htm...

sudo su - hdfs

hdfs dfs -mkdir /user/admin

hdfs dfs -chown root:hdfs /user/admin

View solution in original post

6 REPLIES 6

avatar

@Adrian Savory

See the following:https://community.hortonworks.com/questions/7739/permission-denied-and-no-such-file-or-directory.htm...

sudo su - hdfs

hdfs dfs -mkdir /user/admin

hdfs dfs -chown root:hdfs /user/admin

avatar

@Ancil McBarnett Thanks for the prompt reply. Where can I run these commands from? I've only really used the Hive view so far.

avatar
Master Mentor

@Adrian Savory You can use ssh or browser

http://127.0.0.1:4200

or

ssh -p 2222 root@127.0.0.1

avatar
Expert Contributor

Hi @Adrian Savory what tutorial are you following. I thought the tutorial mentioned to load to /tmp/admin which it states to create I believe mentioned here:

http://hortonworks.com/hadoop-tutorial/hello-world-an-introduction-to-hadoop-hcatalog-hive-and-pig/#...

avatar

@rmolina it's this one:

http://hortonworks.com/hadoop-tutorial/how-to-process-data-with-apache-hive/

Navigate to /user/admin and click on the Upload button.

avatar

All sorted now thanks. I could not tell how to change permissions within the Hive shell and did not know how to get to a command line to run the hdfs commands. Looking at the other tutorial I could see that you needed to right click on the files/directories to change permissions (not obvious on a mac!). So I've now been able to create /user/admin, change permissions and run the load.

Thanks again!