hive搭建的前提:hadoop环境已经搭建好
我用的版本是hive1.1,apache-hive-1.1.0-bin.tar.gz,提取码:y4r9
将下载好的hive上传到master主机上并解压
--解压 [root@master ~]# tar -zxvf apache-hive-1.1.0-bin.tar.gz -C /usr/local/ --重命名 [root@master ~]# mv /usr/local/apache-hive-1.1.0-bin/ /usr/local/hive/进入conf目录下
[root@master hive]# cd /usr/local/hive/conf/后面运行hive可能会出现Terminal initialization failed; falling back to unsupported的报错信息,那是因为hadoop目录下的jline版本和hive目录下的版本不同导致的,hive是基于hadoop运行的
将hive目录下的jline拷贝到hadoop目录下 [root@master lib]# cp /usr/local/hive/lib/jline-2.12.jar /root/hadoop/share/hadoop/yarn/lib/ 加上bak后缀使原先hadoop的jline不生效 [root@master lib]# mv jline-0.9.94.jar jline-0.9.94.jar.bak注意:这里是你自己的hadoop目录路径
运行hive前先启动集群
[root@master conf]# start-dfs.sh [root@slave2 ~]# start-yarn.sh [root@master ~]# hive 敲回车 Logging initialized using configuration in jar:file:/usr/local/hive/lib/hive-common-1.1.0.jar!/hive-log4j.properties SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/root/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/local/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>有什么问题欢迎留言