刘明帅
热爱生活!
刘明帅
HIVE 搭建实战
HIVE 搭建实战

实验环境:

  • Centos 7主机三台
主机名IP地址
Master10.30.59.130
Slave110.30.59.131
Slave210.30.59.132

软件要求:

软件名称软件版本
JDK8u77
Zookeeper3.4.5
Hadoop2.6.0
Hive1.1.0

  • 软件约定
    • 安装包在 /opt/soft
    • 安装目录在 /opt

先决条件:

实验步骤:

一、解压组件

[root@master ~]# cd /opt 
[root@master opt]# tar -xzvf soft/apache-hive-1.1.0-bin.tar.gz 
[root@master opt]# mv apache-hive-1.1.0-bin/ hive 

二、填写配置文件

[root@master opt]# vi hive/conf/hive-site.xml 
  • 查找并修改以下K-V键值对
    • hive.exec.local.scratchdir
      • /opt/hive/tmp
    • hive.downloaded.resources.dir
      • /opt/hive/tmp
    • hive.querylog.location
      • /opt/hive/tmp
    • javax.jdo.option.ConnectionURL
      • jdbc:mysql://127.0.0.1:3306/hive?createDatabaseIfNotExist=true&useSSL=false
    • javax.jdo.option.ConnectionDriverName
      • com.mysql.jdbc.Driver
    • javax.jdo.option.ConnectionUserName
      • root
    • javax.jdo.option.ConnectionPassword
      • P@ssw0rd

三、配置环境变量并令其立即生效

  • hadoop-etc.sh文件新增两条
[root@master opt]# vi /etc/profile.d/hadoop-etc.sh
export HIVE_HOME=/opt/hive
export PATH=$PATH:$HIVE_HOME/bin

[root@master opt]# source /etc/profile.d/hadoop-etc.sh

三、修复兼容性

[root@master opt]# cp hive/lib/jline-2.12.jar hadoop/share/hadoop/yarn/lib/ 
[root@master opt]# mv hadoop/share/hadoop/yarn/lib/jline-0.9.94.jar hadoop/share/hadoop/yarn/lib/jline-0.9.94.jar.bak 

四、初始化

[root@master opt]# cp soft/mysql-connector-java-5.1.47-bin.jar hive/lib/ 
[root@master opt]# schematool -initSchema -dbType mysql 
[root@master opt]# schematool -initSchema -dbType mysql 
Metastore connection URL:	 jdbc:mysql://127.0.0.1:3306/hive?createDatabaseIfNotExist=true&useSSL=false
Metastore Connection Driver :	 com.mysql.jdbc.Driver
Metastore connection User:	 root
Starting metastore schema initialization to 1.1.0
Initialization script hive-schema-1.1.0.mysql.sql
Initialization script completed
schemaTool completed

五、实验验证

[root@master opt]# hive

Logging initialized using configuration in jar:file:/opt/hive/lib/hive-common-1.1.0.jar!/hive-log4j.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hive/lib/hive-jdbc-1.1.0-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
hive> 

文章链接: https://lmshuai.com
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明出处!

推荐文章

发表评论

textsms
account_circle
email

刘明帅

HIVE 搭建实战
实验环境: Centos 7主机三台 主机名IP地址Master10.30.59.130Slave110.30.59.131Slave210.30.59.132 软件要求: 软件名称软件版本JDK8u77Zookeeper3.4.…
扫描二维码继续阅读
2019-07-19