hive1.2.1安装详解(亲测有效)

本文档详细介绍了在Hadoop 2.6.0环境下安装Hive 1.2.1的步骤,包括下载解压、配置环境变量、编辑配置文件如hive-env.sh和hive-site.xml,以及解决安装过程中的常见问题,如连接错误、元数据问题、权限问题等。通过这篇教程,读者可以了解如何在分布式环境中正确配置和启动Hive。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、下载apache-hive-1.2.1-bin.tar.gz并解压
$tar -xf apache-hive-1.2.1-bin.tar.gz
$cd apache-hive-1.2.1-bin
$cd conf

2、复制hive-env.sh.tmplate为hive-env.sh,复制hive-default.xml.tmplate为hive-site.xml

1)$vim hive-env.sh,增加如下内容
HADOOP_HOME=/usr/local/hadoop-2.6.0
export HIVE_CONF_DIR=/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/conf
export HIVE_HOME=/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin

2)$vim hive-site.xml,修改如下内容:
< property >
< name>hive.exec.scratchdir< /name>
< !–< value>/tmp/hive< /value>–>
< value>hdfs://Master:9000/hive/scratchdir< /value>
< description>HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/<username> is created, with ${hive.scratch.dir.permission}.< /description>
< /property>
< property>
< name>hive.exec.local.scratchdir< /name>
< !–< value>${/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/iotmp}/${system:user.name}< /value>–>
< value>/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/iotmp< /value>
< description>Local scratch space for Hive jobs< /description>
< /property>
< property>
< name>hive.downloaded.resources.dir< /name>

< value>/usr/local/hadoop-2.6.0/apache-hive-1.2.1-bin/iotmp< /value>
< description>Temporary local directory for added resources in the remote file system.< /description>
< /property>
< property>
< name>hive.metastore.warehouse.dir< /name>
< !–< value>/user/hive/warehouse< /value>–>
< value>hdfs://Master:9000/hive/warehousedir
< description>location of default database for the warehouse

< property>
< name>hive.metastore.uris
< value/>
< !–< value>thrift://Master:9084–>
< description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.

< property>
< name>javax.jdo.option.ConnectionPassword
< !–< value>mine–>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值