java hdfs路径_Hive Warehouse路径使用 - 默认路径而不是我自己的hdfs路径

问题与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>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值