问题与Apache Hive 1.1.0和.hiverc有关
我已经安装了apache hive 1.1.0 . 默认情况下hive hdfs home:/ user / hive / warehouse,hdfs temp:/ tmp
我有unix机器上的用户hdpadmin,hiveuser现在我有我的应用程序特定的HDFS路径
Probelm:数据库是在默认仓库目录而不是应用程序特定目录中创建的:/ app / myApp / HIVE / WAREHOUSE
这是什么解决方案?
[root@cdh1 ~]# su - hiveuser
[hiveuser@cdh1 ~]$ vim .hiverc [created a hiverc file]
SET hive.metastore.warehouse.dir=/app/myApp/HIVE/WAREHOUSE;
SET hive.exec.scratchdir=/app/myApp/HIVE/TMP;
save and close
[hiveuser@cdh1 ~]$ hive
[hiveuser@cdh1 ~]$ hive
Logging initialized using configuration in jar:file:/opt/cloudera/parcels/CDH-5.4.5-1.cdh5.4.5.p0.7/jars/hive-common-1.1.0-cdh5.4.5.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive> set hive.metastore.warehouse.dir;
hive.metastore.warehouse.dir=/app/myApp/HIVE/WAREHOUSE
hive> set hive.exec.scratchdir;
hive.exec.scratchdir=/app/myApp/HIVE/TMP
hive> create database temp;
OK
Time taken: 0.561 seconds
hive> dfs -ls /app/myApp/HIVE/WAREHOUSE; ['temp' database not shown]
hive> desc database temp; [probelm: Creating in the default warehouse path rather my path : /app/myApp/HIVE/WAREHOUSE]
OK
temp hdfs://nameservice1/user/hive/warehouse/temp.db hiveuser USER
Time taken: 0.217 seconds, Fetched: 1 row(s)
hive>