timeline server介绍

1. timeline是什么
2. timeline能做什么
3. timeline结构
4. timeline怎么配置
 
1). timeline是什么?
它能存储和检索应用当前和历史信息在yarn配置的地址里,它有两个特性:持久化应用特定信息和保存已完成应用的相关信息
 
目前的现状:
1. timeline 服务器的核心功能已完成
2. 它可以工作在安全和非安全的集群上
3. 通用的history server已经构建在timeline store上
4. timeline的的存储可以存在在内存和leveldb的数据库中,后者可以保证重启timeline server后可以保存历史记录
5. 不支持在yarn中安装特定于框架的UIs
6. 应用程序特定的信息只能通过使用json类型内容的RESTful APIs获得
7. timeline server v1的rest api已经声明作为其他rest APIs之一,其兼容性将在将来的版本中维护
8. timeline server单实例限制了服务的可伸缩性,不支持高可用
 
将来计划:
1. 未来版本将引入可扩展且可靠下一代timeline server,"timeline server v2"
2. 扩展应用不能使用timeline server v1 rest API服务的功能,它将包括扩展数据结构以及客户端在时间线服务器实例之间进行故障切换的能力
 
2. timeline能做什么
1. 持久化应用特定信息:
它能收集和检索应用或者框架的完整信息。
例如:
hadoop的MapReduce框架它包含的信息像多少个map tasks,reduce tasks,counters等等
 
应用开发者发布的指定的信息到timeline server通过在application master or application的containers里的timeline client
 
这些信息可以通过rest api可查询,以便由特定应用程序或者框架的uis进行渲染
 
2. 保存已完成应用的相关信息:
jobhistory仅支持MapReduce作业的任务,随着timeline server的出现,应用的history将只是timeline server的一部分
 
通用信息包括应用层数据,比如:
队列名
用户信息以及应用的上下文信息
运行任务的尝试列表
每一个应用尝试的信息
每一个尝试信息下container列表
每个container信息
一般数据由yarn resourcemanager发布到timeline store和由其web ui来显示有关已完成应用程序的信息
 
3. timeline结构
 
Timeline Structure
Timeline Domain(时间轴域)
Timeline域为Timeline服务器提供了一个命名空间,允许用户托管多个实体,将它们与其他用户和应用程序隔离开来。时间轴服务器安全性在此级别定义。
“域”主要存储所有者信息、读取和写入ACL信息、创建和修改的时间戳信息。每个域由ID标识,该ID在yarn集群中的所有用户中必须是唯一的。
 
Timeline Entity(时间线实体)
时间线实体包含概念实体及其相关事件的元信息。
实体可以是应用程序、应用程序尝试、容器或任何用户定义的对象。
它包含将用于索引时间线存储中的实体的主筛选器。
因此,用户/应用程序应仔细选择要存储的信息作为主筛选器。
剩余的数据可以存储为未索引的信息。每个实体由实体id和实体类型唯一标识。
 
Timeline Events(时间线事件)
时间线事件描述与应用程序的特定时间线实体相关的事件。
用户可以自由定义事件的含义,例如启动应用程序、分配容器、操作失败或其他被认为与用户和群集操作员相关的信息。
 
4. timeline怎么配置
vim yarn-site.xml
  1 <!--start timeline settings -->
  2   <property>
  3       <description></description>
  4     <name>yarn.timeline-service.hostname</name>
  5     <value>localhost</value>
  6   </property>
  7 
  8   <property>
  9   <description>Address for the Timeline server to start the RPC server.</description>
 10   <name>yarn.timeline-service.address</name>
 11   <value>${yarn.timeline-service.hostname}:10200</value>
 12 </property>
 13 
 14 <property>
 15   <description>The http address of the Timeline service web application.</description>
 16   <name>yarn.timeline-service.webapp.address</name>
 17   <value>${yarn.timeline-service.hostname}:8188</value>
 18 </property>
 19 
 20 <property>
 21   <description>The https address of the Timeline service web application.</description>
 22   <name>yarn.timeline-service.webapp.https.address</name>
 23   <value>${yarn.timeline-service.hostname}:8190</value>
 24 </property>
 25 
 26 <property>
 27   <description>Handler thread count to serve the client RPC requests.</description>
 28   <name>yarn.timeline-service.handler-thread-count</name>
 29   <value>10</value>
 30 </property>
 31 
 32 <property>
 33   <description>Enables cross-origin support (CORS) for web services where
 34   cross-origin web response headers are needed. For example, javascript making
 35   a web services request to the timeline server,是否支持请求头跨域</description>
 36   <name>yarn.timeline-service.http-cross-origin.enabled</name>  
 37   <value>false</value>
 38 </property>
 39 
 40 <property>
 41   <description>Comma separated list of origins that are allowed for web
 42   services needing cross-origin (CORS) support. Wildcards (*) and patterns
 43   allowed,#需要跨域源支持的web服务所允许的以逗号分隔的列表</description>
 44   <name>yarn.timeline-service.http-cross-origin.allowed-origins</name> 
 45   <value>*</value>
 46 </property>
 47 
 48 <property>
 49   <description>Comma separated list of methods that are allowed for web
 50   services needing cross-origin (CORS) support.,跨域所允许的请求操作</description>
 51   <name>yarn.timeline-service.http-cross-origin.allowed-methods</name>
 52   <value>GET,POST,HEAD</value>
 53 </property>
 54 
 55 <property>
 56   <description>Comma separated list of headers that are allowed for web
 57   services needing cross-origin (CORS) support.允许用于web的标题的逗号分隔列表</description>
 58   <name>yarn.timeline-service.http-cross-origin.allowed-headers</name>
 59   <value>X-Requested-With,Content-Type,Accept,Origin</value>
 60 </property>
 61 
 62 <property>
 63   <description>The number of seconds a pre-flighted request can be cached
 64   for web services needing cross-origin (CORS) support.可以缓存预先传送的请求的秒数</description>
 65   <name>yarn.timeline-service.http-cross-origin.max-age</name>
 66   <value>1800</value>
 67 </property>
 68 
 69 <property>
 70   <description>向资源管理器和客户端指示是否历史记录-服务是否启用。如果启用,资源管理器将启动
 71 记录工时记录服务可以使用历史数据。同样,当应用程序如果启用此选项,请完成.</description>
 72   <name>yarn.timeline-service.generic-application-history.enabled</name>
 73   <value>true</value>
 74 </property>
 75 
 76 <property>
 77   <description>Store class name for history store, defaulting to file system store</description>
 78   <name>yarn.timeline-service.generic-application-history.store-class</name>
 79   <value>org.apache.hadoop.yarn.server.applicationhistoryservice.FileSystemApplicationHistoryStore</value>
 80 </property>
 81 
 82 <property>
 83   <description>向客户端指示是否启用时间线服务。如果启用,最终用户使用的timeline客户端库将发布实体
 84 和事件发送到时间线服务器.</description>
 85   <name>yarn.timeline-service.enabled</name>
 86   <value>true</value>
 87 </property>
 88 
 89 <property>
 90   <description>Store class name for timeline store.</description>
 91   <name>yarn.timeline-service.store-class</name>
 92   <value>org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore</value>
 93 </property>
 94 
 95 <property>
 96   <description>Enable age off of timeline store data.启用timeline时间老化</description>
 97   <name>yarn.timeline-service.ttl-enable</name>
 98   <value>true</value>
 99 </property>
100 
101 <property>
102   <description>Time to live for timeline store data in milliseconds.timeline时间老化时间</description>
103   <name>yarn.timeline-service.ttl-ms</name>
104   <value>6048000000</value>
105 </property>
106   <!--end timeline settings --></span>

 

启动timeline 服务
$HADOOP_YARN_HOME/sbin/yarn-daemon.sh start timelineserver  
 
用户能够通过以下命令访问application的通用历史数据:
$ yarn application -status <Application ID>  
$ yarn applicationattempt -list <Application ID>  
$ yarn applicationattempt -status <Application Attempt ID>  
$ yarn container -list <Application Attempt ID>  
$ yarn container -status <Container ID>  

 

posted on 2018-03-01 14:53  gentleman_hai  阅读(6101)  评论(0编辑  收藏  举报

导航