centOS中安装hive

前端之家收集整理的这篇文章主要介绍了centOS中安装hive前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文主要介绍在centOS中安装hive。

1. 解压apache-hive-1.2.1-bin.zip

2.以hive-default.xml.template为模板,创建hive-site.xml

cp hive-default.xml.template hive-site.xml

3.修改hive-site.xml

将${system:java.io.tmpdir}/${system:user.name}位置,修改自定义tmp目录(/usr/bigdata/apache-hive-1.2.1-bin/tmp)

4.启动hive

进入bin目录,执行hive命令,./hive

5.如果报错java.lang.IncompatibleClassChangeError: Found class jline.Terminal,but interface was expected

打开hadoop/etc/hadoop/hadoop-env.sh,增加export HADOOP_USER_CLASSPATH_FIRST=true

6.安装MysqL

yum install MysqL-server

7.启动 MysqL 服务

service MysqLd start

8.验证MysqL是否成功启动

netstat -nplt |grep 3306

9.将MysqL-connector-java-5.1.39-bin.jar拷贝到apache-hive-1.2.1-bin/lib目录下

10.MysqL中赋予用户权限

grant all on *.* to root@'%' identified by '123456';

11.修改hive-site.xml,配置MysqL

主要配置下面几项内容
  <property>
    <name>javax.jdo.option.ConnectionDriverName</name>
    <value>com.MysqL.jdbc.Driver</value>
    <description>Driver class name for a JDBC Metastore</description>
  </property>

  <property>
    <name>javax.jdo.option.ConnectionURL</name>
    <value>jdbc:MysqL://localhost/hive</value>
    <description>JDBC connect string for a JDBC Metastore</description>
  </property>

  <property>
    <name>javax.jdo.option.ConnectionUserName</name>
    <value>root</value>
    <description>Username to use against Metastore database</description>
  </property>

  <property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>123456</value>
    <description>password to use against Metastore database</description>
  </property>

12.再次启动hive(同步骤4)

13.验证,进入MysqL的hive数据库,使用show tables,显示如下结果



14.至此,hive安装成功。

原文链接:/centos/377493.html

猜你在找的CentOS相关文章