zzzbbx
zzzbbx

Reputation: 10161

How to configure Hive warehouse path?

I modified this part

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/user/hive/warehouse</value>
  <description>location of default database for the warehouse</description>
</property>

of hive-default.xml.template with my own path. When running hive, if I try to create a table it says it could create file://mypath/etc.. and it is still looking for /user/hive/warehouse. Did I do something wrong? I tried to create hive-site.xml, and it does not seem to work either.

Upvotes: 5

Views: 15781

Answers (2)

Kishore
Kishore

Reputation: 5891

Change the warehouse path in hive-site.xml as follows:

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>Your_Path_HERE</value>
  <description>location of default database for the warehouse</description>
</property>

Give the permission to <Your_Path_HERE> directory if it is on local system

sudo chown -R user <Your_Path_HERE>
sudo chmod -R 777 <Your_Path_HERE>

if given path is on HDFS , then stop and start the hadoop services

stop-all.sh
start-all.sh

Upvotes: 6

Ashrith
Ashrith

Reputation: 6855

You have specify the property in hive-site.xml:

<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>/user/hivestore/warehouse </value>
</property>

And once modified try reloading the hive shell by exiting and starting hive-shell.

Also, make sure that everyone using hive have appropriate read/write permissions to the the directory specified in the above property.

Upvotes: 0

Related Questions