Hive集成Tez让大象飞起来

[img]http://dl2.iteye.com/upload/attachment/0114/5700/de4b9062-7d61-3ea5-995d-5ae35deb61c0.jpg[/img]

[size=medium]
基础环境

Apache Hadoop2.7.1
Centos6.5
Apache Hadoop2.7.1
Apache Hbase0.98.12
Apache Hive1.2.1
Apache Tez0.7.0
Apache Pig0.15.0
Apache oozie4.2.0
Apache Spark1.6.0
Cloudrea Hue3.8.1

安装Tez,请参考上篇文章:[url]http://qindongliang.iteye.com/blog/2271440[/url]

安装成功之后,在hadoop/etc/hadoop/下面新建一个tez-site.xml,并配置tez的lib路径:
[/size]



tez.lib.uris
/user/tez



[size=medium]
然后执行命令hadoop fs -mkdir -p /user/tez 在HDFS上创建tez的目录
接着执行hadoop fs -copyFromLocal tezlib/* /user/tez上面tez相关的所有jar到HDFS对应的路径下

有一点需要注意,在实际交替运行pig on tez 和hive on tez时,发现hive报了一个异常:
[/size]

[img]http://dl2.iteye.com/upload/attachment/0114/5702/c427abe2-a767-3d74-b222-411ea19dfaf1.png[/img]

[size=medium]

博客地址:[url]http://qindongliang.iteye.com/[/url]
原始是tez编译出来的这个jar包,与hadoop的里面jar大小不一致,所以就报这个异常了,解决办法,统一按照hadoop里面这个jar包大小运行即可

另外一点需要注意的是,如果集群中装有压缩功能,lzo或者snappy那么也需要将相关的jar包传到/user/tez里面
[/size]

[img]http://dl2.iteye.com/upload/attachment/0114/5704/a3bbc5f7-e55d-3cf5-a139-8a3d76f146fc.png[/img]

[size=medium]
设置tez模式,然后查询:
set hive.execution.engine=tez;
启动相关服务,在hue里面查询
bin/hive --service metastore
bin/hiveserver2
而且,结果还支持图表展示:
[/size]

[img]http://dl2.iteye.com/upload/attachment/0114/5706/0606185f-3eb7-3981-8b79-c7e0828d48ad.png[/img]
[b][color=green][size=large]
扫码关注微信公众号:我是攻城师(woshigcs),我们一起学习,进步和交流!(woshigcs)
本公众号的内容是有关搜索和大数据技术和互联网等方面内容的分享,也是一个温馨的技术互动交流的小家园,有什么问题随时都可以留言,欢迎大家来访!
[/size][/color][/b]
[img]http://dl2.iteye.com/upload/attachment/0104/9948/3214000f-5633-3c17-a3d7-83ebda9aebff.jpg[/img]

你可能感兴趣的:(hive)