Hive的安装
Posted alpha-cat
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hive的安装相关的知识,希望对你有一定的参考价值。
安装hive
1.添加环境变量
18 HIVE_HOME=/home/abby/module/hive-1.1.0-cdh5.15.0
19 PATH=$PATH:$HIVE_HOME/bin
2.修改hive-env.sh 位于 /home/abby/module/hive-1.1.0-cdh5.15.0/conf
47 # Set HADOOP_HOME to point to a specific hadoop install directory
48 HADOOP_HOME=/home/abby/module/hadoop-2.6.0-cdh5.15.0
49
50 # Hive Configuration Directory can be controlled by:
51 export HIVE_CONF_DIR=/home/abby/module/hive-1.1.0-cdh5.15.0/conf
52
53 # Folder containing extra ibraries required for hive compilation/execution can be controlled by:
54 export HIVE_AUX_JARS_PATH=/home/abby/module/hive-1.1.0-cdh5.15.0/lib
3.配置hive-exec-log4j.properties
20 hive.log.dir=/home/abby/module/hive-1.1.0-cdh5.15.0/logs
4.hive-site.xml文件
参考hive-site.txt修改
5.把java-json.jar mysql-connector-java-5.1.40.jar
拷贝HIVE_AUX_JARS_PATH=/home/abby/module/hive-1.1.0-cdh5.15.0/lib 目录
6.启动hive
[abby@abby software]$ hive --service metastore &
[1] 5370
[abby@abby software]$ which: no hbase in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/abby/bin:/home/abby/module/jdk1.8.0_181/bin:/home/abby/module/hadoop-2.6.0-cdh5.15.0/bin:/home/abby/module/hive-1.1.0-cdh5.15.0/bin)
Starting Hive Metastore Server
正常开启标准
jps 能够看到RunJar
[abby@abby software]$ jps
2705 NameNode
5459 Jps
2804 DataNode
5370 RunJar
2987 SecondaryNameNode
启动hive cli命令端
[abby@abby software]$ hive
which: no hbase in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/abby/bin:/home/abby/module/jdk1.8.0_181/bin:/home/abby/module/hadoop-2.6.0-cdh5.15.0/bin:/home/abby/module/hive-1.1.0-cdh5.15.0/bin)
19/09/02 20:32:38 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Logging initialized using configuration in file:/home/abby/module/hive-1.1.0-cdh5.15.0/conf/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive (default)>
hive安装成功的标志
hive (default)> SHOW DATABASES;
OK
database_name
default
Time taken: 1.491 seconds, Fetched: 1 row(s)
hive (default)> CREATE DATABASE hadoop;
OK
Time taken: 0.555 seconds
hive (default)>
注释:过程中abby是自己设置的Linux用户名,而我的hadoop和hive都是在/home/module下面解压的,我的目录完整应是 ~/home/abby/module/各种解压包的直接文件夹(配置PATH直接可用的路径)!
以上是关于Hive的安装的主要内容,如果未能解决你的问题,请参考以下文章