Hive-1.2.1安装配置
上一篇:HBase安装
这一篇进行Hive-1.2.1的安装与基本配置。
Hive下载:点击进入下载Hive
安装
# tar -zxvf apache-hive-1.2.1-bin.tar.gz -C /usr/hadoop/# cd /usr/hadoop# mv apache-hive-1.2.1-bin hive-1.2.1
配置环境变量
# vim /etc/profile
export HIVE_HOME=/usr/hadoop/hive-1.2.1 |
# source /etc/profile
配置hive-env.sh
# cd $HIVE_HOME/conf# cp hive-env.sh.template hive-env.sh# vim hive-env.sh
HADOOP_HOME=/usr/hadoop/hadoop-2.7.3 |
配置hive-site.xml(需要新建)
指定元数据库存储库,需要预先创建好。
这里使用Mysql,数据库名为hive,字符集为latin1。
为什么不用utf8?
你自己试一下就知道了~# vim hive-site.xml
<configuration> |
启动
- 启动前需要确保Hadoop服务已启动!!!
- 启动前需要添加Mysq连接驱动到
$HIVE_HOME/lib/目录下!!!
启动HiveMetaStore
- 直接启动:
# hive --service metastore - 后台启动(关闭shell连接依然存在)
# nohup hive --service metastore >> /var/hivelog.log 2>&1 &默认metastore端口为:9083
启动HiveServer2
- 直接启动:
# hiveserver2 - 后台启动
# nohup hiveserver2 >> /var/hivelog.log 2>&1 &默认hive.server2.thrift.port=10000
默认hive.server2.thrift.http.port=10001
查看进程
Hive命令行工具(推荐使用Beeline)
使用hive cli
# hive
[root@master1 conf]# hive |
使用Beeline
需要确保hiveserver2服务已启动。# beeline
退出beeline:!q
OVER
Hive安装部分已结束!