hive安装配置

Posted camelroyu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hive安装配置相关的知识,希望对你有一定的参考价值。

前提: 安装好mysql ,新建数据库hive,新建用户hive:hive ,并且允许远程登录和访问 

GRANT ALL PRIVILEGES ON *.* TO hive@master IDENTIFIED BY hive WITH GRANT OPTION;
flush privileges;

开始: 

1.. 

Hive下载:http://archive.cloudera.com/cdh5/cdh/5/
wget http://archive.cloudera.com/cdh5/cdh/5/hive-1.1.0-cdh5.7.0.tar.gz

 

2. 解压

tar -zxvf hive-1.1.0-cdh5.7.0.tar.gz -C ~/app/

 

3. 配置系统环境变量( centos:~/.bahs_profile | ubuntu: /etc/profile )
export HIVE_HOME=/home/hadoop/app/hive-2.1.1
export PATH=$HIVE_HOME/bin:$PATH
4. hive安装路径下新建存储目录iotmp,并且赋予相应的权限 chmod 777 %HIVE_HOME/iotmp

 

5. 配置 hive-site.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hive.exec.scratchdir</name>
<value>/usr/local/hadoop/hive/tmp</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}/&lt;username&gt; is created, with ${hive.scratch.dir.permission}.</description>
</property>
<property>
<name>hive.exec.local.scratchdir</name>
<value>/usr/local/hadoop/hive/iotmp</value>
<description>Local scratch space for Hive jobs</description>
</property>
<property>
<name>hive.downloaded.resources.dir</name>
<value>/usr/local/hadoop/hive/iotmp</value>
<description>Temporary local directory for added resources in the remote file system.</description>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://172.16.1.80:3306/hive?createDatabaseIfNotExit=true&amp;characterEncoding=UTF-8</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUsername</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
</property>



</configuration>

 

 

6. 拷贝mysql驱动到$HIVE_HOME/lib/

7. 启动hive: $HIVE_HOME/bin/hive

 

以上是关于hive安装配置的主要内容,如果未能解决你的问题,请参考以下文章

Hive安装与配置详解

Hive安装与配置详解

Hive---- Hive安装及配置

Hive 2.1.1安装配置

如何安装SAS并配置连接Hive/Impala

cenos7安装MySQL配置hive(下)