Bug死磕之hue集成的oozie+pig出现资源任务死锁问题
2016-01-14 23:02
495 查看
一安装hue
1,到官网下载 http://gethue.com/categ
2,解压到某个目录hue
3,安装依赖:yum install -y asciidoc cyrus-sasl-deve++ krb5-devel libtidy libxml2-devel libxslt-devel make mysql mysql-devel openldap-devel python-devel sqlite-devel openssl-devel gmp-devel
4,进入hue目录,运行make apps编译
5,配置desktop/conf/hue.ini
6,启动build/env/bin/supervisor 杀死脚本(ps -ef | grep hue- | gawk '{print $2}' | xargs kill -9)
伦理片 http://www.dotdy.com/
如果你的hue只是用来操作hive的,那么没必要安装oozie了,那么整个流程就简单了,进入hive目录启动memstore和hiveserver2服务即可: bin/hive --service metastore
bin/hiveserver2
一个使用hue查询的hive的查询如下:
很漂亮,用来调试sql非常方便,如果你想使用工作流或者pig功能,那么就需要安装oozie了
oozie安装编译比较坑,这里需要注意一下,目前最新的版本oozie的最新版本是4.2.0,但是依赖的
hive只支持0.13.1
hbase支持到0.94.2
spark,hadoop,pig均可支持当然最新版本
而且pom文件里面用到的codehash镜像已经失效,如果不去掉,则会编译失败:
Java代码
<repository>
<id>Codehaus repository</id>
<url>http://repository.codehaus.org/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
(二) 安装oozie
1,下载oozie
wget http://archive.apache.org/dist/oozie/4.2.0/oozie-4.2.0.tar.gz
2,解压至某个盘符,修改其根目录下的pom文件里面的pig(加载类是h2,代表hadoop2.x),hadoop,hbase,hive,spark等版本,hbase和hive使用最新的可能会编译失败,这一点需要注意,经测试hbase0.94.2和hive0.13.1可正常编译通过,
3,修改完毕后,执行编译
bin/mkdistro.sh -P hadoop-2 -DskipTests
或
mvn clean package assembly:single -P hadoop-2 -DskipTests
4,执行成功后,拷贝oozie-4.2.0/distro/target/oozie-4.2.0-distro.tar.gz 至安装目录,
具体请参考我的这篇文章:
(三)在hue里面测试pig脚本:
写一个简单的pig脚本:
点击运行,发现oozie会启动两个任务,一个是launcher,一个pig脚本,lancher任务一直卡着95%进度,不再有任何变化,而主体的pig脚本,则一直在初始化阶段,不能被执行,看日志log无任何错误,就是一直打印
Heart beat
Heart beat
Heart beat
......
经过查资料,发现在集群小的时候,如果集群资源不充足,导致RM无法分配多个MR的资源,就会一直等待,然后整个任务就会处于假死状态,一直死锁不运行,其实就是多个MR任务,抢占资源,导致最后谁也运行不了造成的,如何解决?
方案一:
切换haodop集群默认使用的容量调度器为公平调度器,允许当前队列最多只能运行一个MR任务,多了就阻塞等待。
方案二:
切换haodop集群默认使用的容量调度器为公平调度器,创建多个队列把任务提交到不同的队列里面,避免资源抢占
Xml代码
<property>
<name>yarn.resourcemanager.scheduler.class</name>
<value>org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FairScheduler</value>
</property>
<property>
<name>yarn.scheduler.fair.allocation.file</name>
<value>file:/%HADOOP_HOME%/etc/hadoop/fair-scheduler.xml</value>
lt;/property>
fair-scheduler.xml配置:
Xml代码
<?xml version="1.0"?>
<allocations>
<queue name="test">
<minResources>1000 mb, 1 vcores</minResources>
<maxResources>5000 mb, 1 vcores</maxResources>
<maxRunningApps>1</maxRunningApps>
<aclSubmitApps>webmaster</aclSubmitApps>
<weight>2.0</weight>
<schedulingPolicy>fair</schedulingPolicy>
<queue name="test-sub">
<aclSubmitApps>webmaster</aclSubmitApps>
<minResources>500 mb, 1 vcores</minResources>
</queue>
</queue>
<user name="root">
<maxRunningApps>1</maxRunningApps>
</user>
<user name="webmaster">
<maxRunningApps>1</maxRunningApps>
</user>
<!--
<user name="gpadmin">
<maxRunningApps>5</maxRunningApps>
</user>-->
<userMaxAppsDefault>1</userMaxAppsDefault>
<fairSharePreemptionTimeout>30</fairSharePreemptionTimeout>
</allocations>
关于hadoop的资源调度,请参考下面
影音先锋电影 http://www.iskdy.com/
修改完成后同步分发所有的hadoop节点,并拷贝一份到oozie/conf/hadoop-conf/下面一份,重启hadoop集群和oozie服务,再次执行脚本,发现运行没有问题:
如果还想配置,solr,hbase,只要在hue.ini里面配置即可,注意hbase的服务,需要启动hbase的thrift端口才行,
bin/hbase-daemon.sh start thrift
然后在hue.ini里面配置: hbase_clusters=(Cluster|h1:9090),必须是这种格式,否则hue不会识别
配置solr比较简单,支持写上solr的url即可:
扫码关注微信公众号:我是攻城师(woshigcs),我们一起学习,进步和交流!(woshigcs)
本公众号的内容是有关搜索和大数据技术和互联网等方面内容的分享,也是一个温馨的技术互动交流的小家园,有什么问题随时都可以留言,欢迎大家来访!
相关文章推荐
- UILabel 多行高度自适应 计算高度存在的 坑
- UI开发中Button基本方法
- UITableView中的cell的优化
- UITableView性能优化-一次面试后的反思总结
- easyui的iconCls无法显示
- UI课程(界面通信)
- Android Stuido 问题汇总
- UITableView中的cell的优化
- 解决select2 在easyui dialog中不显示下拉列表的问题
- @GeneratedValue的用法
- 做哪些优化,才能让 UITabelView 更顺滑?(转)
- 详细整理:UITableView优化技巧
- 【bzoj2967】【JSOI2008】【Blue Mary的战役地图】【hash】
- UIScrollView的仔细的研究API的记录
- 分布式系统中 Unique ID 的生成方法
- 常用ui组件总结
- HDU 2734 Quicksum【水 字符串】
- iOS开发之UI篇第二弹
- UI基础__类似QQ好友列表制作
- Android Studio 常见 Build 问题 Error:failed to find Build Tools revision 23.0.2