timeline server介绍

时间:2023-03-09 22:04:33
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 server介绍
timeline server介绍
Timeline Domain(时间轴域)
Timeline域为Timeline服务器提供了一个命名空间,允许用户托管多个实体,将它们与其他用户和应用程序隔离开来。时间轴服务器安全性在此级别定义。
“域”主要存储所有者信息、读取和写入ACL信息、创建和修改的时间戳信息。每个域由ID标识,该ID在yarn集群中的所有用户中必须是唯一的。
Timeline Entity(时间线实体)
时间线实体包含概念实体及其相关事件的元信息。
实体可以是应用程序、应用程序尝试、容器或任何用户定义的对象。
它包含将用于索引时间线存储中的实体的主筛选器。
因此,用户/应用程序应仔细选择要存储的信息作为主筛选器。
剩余的数据可以存储为未索引的信息。每个实体由实体id和实体类型唯一标识。
Timeline Events(时间线事件)
时间线事件描述与应用程序的特定时间线实体相关的事件。
用户可以*定义事件的含义,例如启动应用程序、分配容器、操作失败或其他被认为与用户和群集操作员相关的信息。
4. timeline怎么配置
vim yarn-site.xml
 <!--start timeline settings -->
<property>
<description></description>
<name>yarn.timeline-service.hostname</name>
<value>localhost</value>
</property> <property>
<description>Address for the Timeline server to start the RPC server.</description>
<name>yarn.timeline-service.address</name>
<value>${yarn.timeline-service.hostname}:10200</value>
</property> <property>
<description>The http address of the Timeline service web application.</description>
<name>yarn.timeline-service.webapp.address</name>
<value>${yarn.timeline-service.hostname}:8188</value>
</property> <property>
<description>The https address of the Timeline service web application.</description>
<name>yarn.timeline-service.webapp.https.address</name>
<value>${yarn.timeline-service.hostname}:8190</value>
</property> <property>
<description>Handler thread count to serve the client RPC requests.</description>
<name>yarn.timeline-service.handler-thread-count</name>
<value>10</value>
</property> <property>
<description>Enables cross-origin support (CORS) for web services where
cross-origin web response headers are needed. For example, javascript making
a web services request to the timeline server,是否支持请求头跨域</description>
<name>yarn.timeline-service.http-cross-origin.enabled</name>
<value>false</value>
</property> <property>
<description>Comma separated list of origins that are allowed for web
services needing cross-origin (CORS) support. Wildcards (*) and patterns
allowed,#需要跨域源支持的web服务所允许的以逗号分隔的列表</description>
<name>yarn.timeline-service.http-cross-origin.allowed-origins</name>
<value>*</value>
</property> <property>
<description>Comma separated list of methods that are allowed for web
services needing cross-origin (CORS) support.,跨域所允许的请求操作</description>
<name>yarn.timeline-service.http-cross-origin.allowed-methods</name>
<value>GET,POST,HEAD</value>
</property> <property>
<description>Comma separated list of headers that are allowed for web
services needing cross-origin (CORS) support.允许用于web的标题的逗号分隔列表</description>
<name>yarn.timeline-service.http-cross-origin.allowed-headers</name>
<value>X-Requested-With,Content-Type,Accept,Origin</value>
</property> <property>
<description>The number of seconds a pre-flighted request can be cached
for web services needing cross-origin (CORS) support.可以缓存预先传送的请求的秒数</description>
<name>yarn.timeline-service.http-cross-origin.max-age</name>
<value>1800</value>
</property> <property>
<description>向资源管理器和客户端指示是否历史记录-服务是否启用。如果启用,资源管理器将启动
记录工时记录服务可以使用历史数据。同样,当应用程序如果启用此选项,请完成.</description>
<name>yarn.timeline-service.generic-application-history.enabled</name>
<value>true</value>
</property> <property>
<description>Store class name for history store, defaulting to file system store</description>
<name>yarn.timeline-service.generic-application-history.store-class</name>
<value>org.apache.hadoop.yarn.server.applicationhistoryservice.FileSystemApplicationHistoryStore</value>
</property> <property>
<description>向客户端指示是否启用时间线服务。如果启用,最终用户使用的timeline客户端库将发布实体
和事件发送到时间线服务器.</description>
<name>yarn.timeline-service.enabled</name>
<value>true</value>
</property> <property>
<description>Store class name for timeline store.</description>
<name>yarn.timeline-service.store-class</name>
<value>org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore</value>
</property> <property>
<description>Enable age off of timeline store data.启用timeline时间老化</description>
<name>yarn.timeline-service.ttl-enable</name>
<value>true</value>
</property> <property>
<description>Time to live for timeline store data in milliseconds.timeline时间老化时间</description>
<name>yarn.timeline-service.ttl-ms</name>
<value>6048000000</value>
</property>
<!--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>