Dr.Elephant开发者指南
收录自:http://blog.csdn.net/qsc0624/article/details/51274145
------------------------
创建Dr.Elephant项目
获取源代码
编译代码
$> ./compile.sh [./app-conf/compile.conf]
hadoop_version = 2.3.0 // The Hadoop version to compile with
spark_version = 1.4.0 // The Spark version to compile with
play_opts="-Dsbt.repository.config=app-conf/resolver.conf" // Other play/sbt options
测试Dr.Elephant
启动单元测试
本地部署测试Dr.Elephant
准备工作
Yarn和Hadoop/Spark
$>export HADOOP_HOME=/path/to/hadoop/home
$>export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
将Hadoop的Home目录添加到系统环境变量,Dr.Elephant会使用到Hadoop的Classpath中的某些Class文件。
$>export PATH=$HADOOP_HOME/bin:$PATH
数据库
Dr.Elephant需要将任务信息和任务的诊断信息存储在本地数据库MySQL中。
mysql> create database drelephant
在Dr.Elephant的配置文件app-conf/elephant.conf中可以配置数据库的url、数据库名称、用户名称和密码。
使用其他数据库
目前,Dr.Elephant默认是用MySQL数据库。我们可以在演化文件(evolution files)中看到MySQL的DDL声明。如果我们希望能够使用其他的数据库,可以参考这里进行配置。
本地安装Dr.Elephant
完成上面的安装前准备之后,可以开始在本地安装Dr.Elephant。
$> $HADOOP_HOME/sbin/mr-jobhistory-daemon.sh start historyserver
$>cd dist; unzip dr-elephant*.zip;cd dr-elephant*
$> vim ./app-conf/elephant.conf
jvm_props=" -Devolutionplugin=enabled -DapplyEvolutions.default=true"
启动Dr.Elephant时,运行start.sh脚本,并在参数中带上应用程序的配置文件目录。
$> $DR_RELEASE/bin/start.sh $DR_RELEASE/../../app-conf
当Dr.Elephant运行成功之后,可以通过”ip:port”(localhost:8080)在浏览器中打开UI。
Dr.Elephant的日志默认输出到dr-elephant发布目录的同级目录dist中。
$> less $DR_RELEASE/../logs/elephant/dr_elephant.log
项目结构
app → Contains all the source files
└ com.linkedin.drelepahnt → Application Daemons
└ org.apache.spark → Spark Support
└ controllers → Controller logic
└ models → Includes models that Map to DB
app-conf → Application Configurations
└ elephant.conf → Port, DB, Keytab and other JVM Configurations (Overrides application.conf)
└ FetcherConf.xml → Fetcher Configurations
└ HeuristicConf.xml → Heuristic Configurations
└ JobTypeConf.xml → JobType Configurations
└ application.conf → Main configuration file
└ log4j.properties → log configuration file
└ wiki → Contains the images used in the wiki documentation
└ start.sh → Starts Dr. Elephant
└ stop.sh → Stops Dr. Elephant
test → Source folder for unit tests
compile.sh → Compiles the application
启发式算法
添加新的启发式算法
我们可以按照下面的步骤去添加自定义的启发式算法,并把它添加到Dr.Elephant中。
- 创建新的启发式算法,并完成测试。
- 为该启发式算法创建一个新的view页,例如helpMapperSpill.scala.html。
- 在HeuristicConf.xml文件中添加该启发式算法的详情。
- HeuristicConf.xml文件中启发式算法的详情包含以下内容:
i. 应用程序类型:是mapreduce程序还是spark程序。
<applicationtype>mapreduce</applicationtype>
<heuristicname>Mapper GC</heuristicname>
<classname>com.linkedin.drelephant.mapreduce.heuristics.MapperGCHeuristic</classname>
<viewname>views.html.help.mapreduce.helpGC</viewname>
配置启发式算法
每个启发式算法都有一些阈值,用来计算不同的待优化等级。我们可以在HeuristicConf.xml文件中指定这些阈值。
<applicationtype>mapreduce</applicationtype>
<heuristicname>Mapper Data Skew</heuristicname>
<classname>com.linkedin.drelephant.mapreduce.heuristics.MapperDataSkewHeuristic</classname>
<viewname>views.html.help.mapreduce.helpMapperDataSkew</viewname>
<num_tasks_severity>10, 50, 100, 200</num_tasks_severity>
<deviation_severity>2, 4, 8, 16</deviation_severity>
<files_severity>1/8, 1/4, 1/2, 1</files_severity>
分数计算
在Dr.Elephant中,使用启发式算法来分析运行完成的任务,会得到一个分数。这个分数的计算方法比较简单,可以通过将待优化等级的值乘以作业(task)数量。
if (severity != Severity.NONE&& severity!= Severity.LOW) {
score = severity.getValue()* tasks;
作者简介:屈世超,专注于大数据。曾任职小米科技公司服务端后台开发工程师,现担任EverString数据平台组高级开发工程师。
Dr.Elephant开发者指南相关推荐
- Dr. Elephant大象医生安装文档
Dr.Elephant被定位成一个对Hadoop和Spark任务进行性能监控和调优的工具,它能够自动收集Hadoop平台所有的度量标准,并对收集的数据进行分析,并将分析结果以一种简单且易于理 ...
- Dr.Elephant简介
收录自http://blog.csdn.net/qsc0624/article/details/51249020 --------- Dr.Elephant被定位成一个对Hadoop和Spark任务进 ...
- google ProtoBuf开发者指南
目录 1 概览 1.1 什么是protocol buffer 1.2 他们如何工作 1.3 为什么不用XML? 1.4 听起来像是为我的解决方案,如何开始? 1.5 一点历史 ...
- Android开发者指南(22) —— Accessing Resources
前言 本章内容为Android开发者指南的Framework Topics/Application Resources/Accessing Resources章节,译为"资源调用" ...
- Android开发者指南(18) —— Web Apps Overview
前言 本章内容为开发者指南(Dev Guide)/Web Applications/Web Apps Overview,版本为Android 3.2 r1,翻译来自:"happyjiahan ...
- Android开发者指南(4) —— Application Fundamentals
前言 本章内容为开发者指南(Dev Guide)/Framework Topics/Application Fundamentals,版本为Android2.3 r1,翻译转载并整理自译言:" ...
- Spring Security OAuth 2开发者指南译
Spring Security OAuth 2开发者指南译 介绍 这是用户指南的支持OAuth 2.0.对于OAuth 1.0,一切都是不同的,所以看到它的用户指南. 本用户指南分为两部分,第一部分为 ...
- 【译】①JWS之Java[tm] Web Start开发者指南目录
为什么80%的码农都做不了架构师?>>> Java[tm] Web Start开发者指南1.2版本. 这个开发者指南提供了怎么使用Java[tm] web start和jnlp ...
- Android开发者指南(5) —— monkeyrunner
前言 本章内容为开发者指南(Dev Guide)/Developing/Tools/monkeyrunner,版本为Android2.3 r1,翻译转载并整理自译言:"biAji" ...
最新文章
- Waymo无人卡车高调重返凤凰城,但货运先机已失
- 从零开始学习 ASP.NET MVC 1.0 (三) Controller/Action 深入解析与应用实例 【转】
- 理解Kubernetes(2): 应用的各种访问方式
- java logic_Java Logic总结2
- single-number-ii
- 新加坡科技设计大学(SUTD)招收计算机视觉方向全奖PhD学生
- linux 两个序列比对,如何用COBALT构建本地的多序列比对(Linux系统)
- Jmeter-3.0的源码导入eclipse并执行
- P3172-[CQOI2015]选数【dp,容斥】
- extjs弹出窗口查看文本内容-new Ext.Window
- leetcode 778. 水位上升的泳池中游泳(并查集)
- VB100十月测试:360可牛凯歌高奏 金山失利瑞星缺席
- Lnmp上安装Yaf学习(一)
- 『TensorFlow』批处理类
- csdn博客登录不上-why?
- BoundsChecker使用
- Gitblit安装遇到的一些问题
- linux返回上一步命令
- svn 服务器ip地址变更
- c语言OBD编程,汽车OBD2诊断程序开发
热门文章
- 乐华阅卷系统打不开服务器,乐华网上阅卷系统1.0操作手册.docx
- AI会抢走我们的饭碗?现在报告破解谜失
- (十)基于Linux算时差——超声波测距原理及代码实现
- 阿里云StreamCompute流计算架构
- 跨域:postMessage
- org.apache.jasper.JasperException: /WEB-INF/menu-page.jsp (line: 108, column: 1) File [modal-menu-a
- 数据库管理工具DBeaver的下载以及安装
- 51单片机简易交通灯控制
- 2015考研数学复习全书【数一】
- 【调剂】东北石油大学地球科学学院地震资料处理团队接受调剂研究生