【发布时间】:2020-01-16 16:40:51
【问题描述】:
与 Apache Hive 1.1.0 和 .hiverc 相关的问题
我已经安装了 apache hive 1.1.0。 默认情况下 hive hdfs home : /user/hive/warehouse, hdfs 温度:/tmp
我在 unix 机器上有用户 hdpadmin, hiveuser 现在我有了特定于应用程序的 HDFS 路径
问题:正在默认仓库目录而不是应用程序特定目录中创建数据库:/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>
【问题讨论】: