Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive failed to create /user/hive/warehouse

Tags:

hadoop

hive

I just get started on Apache Hive, and I am using my local Ubuntu box 12.04, with Hive 0.10.0 and Hadoop 1.1.2.

Following the official "Getting Started" guide on Apache website, I am now stuck at the Hadoop command to create the hive metastore with the command in the guide:

$ $HADOOP_HOME/bin/hadoop fs -mkdir       /user/hive/warehouse

the error was mkdir: failed to create /user/hive/warehouse

Does Hive require hadoop in a specific mode? I know I didn't have to do much to my Hadoop installation other that update JAVA_HOME so it is in standalone mode. I am sure Hadoop itself is working since I am run the PI example that comes with hadoop installation.

Also, the other command to create /tmp shows the /tmp directory already exists so it didn't recreate, and /bin/hadoop fs -ls is listing the current directory.

So, how can I get around it?

like image 896
yutechnet Avatar asked Sep 28 '13 15:09

yutechnet


1 Answers

When running hive on local system, just add to ~/.hiverc:

SET hive.metastore.warehouse.dir=${env:HOME}/Documents/hive-warehouse;

You can specify any folder to use as a warehouse. Obviously, any other hive configuration method will do (hive-site.xml or hive -hiveconf, for example).

That's possibly what Ambarish Hazarnis kept in mind when saying "or Create the warehouse in your home directory".

like image 125
wonder.mice Avatar answered Oct 12 '22 22:10

wonder.mice