分享

YARN Timeline Server(hadoop2.7.1)——配置篇

helianthus 发表于 2015-12-27 18:50:44 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 36021
本帖最后由 helianthus 于 2015-12-27 18:48 编辑
问题导读:
1.启动yarn timeline service需要哪些配置?
2.怎么给hadoop集群配置yarn timeline service?







1.基本配置
yarn.timeline-service.enabled 该参数用于决定是否开启或关闭timeline service,如果开启(true),应用程序就会通过TimelineClient库将相关entities和events发给Timeline server。默认为false.
yarn.resourcemanager.system-metrics-publisher.enabled 该参数用于决定是否将yarn metrics通过RM发布到timeline server上,默认false.
yarn.timeline-service.generic-application-history.enabled是否允许client通过 timeline history-service查询一些generic data.如果不开启此参数,那么应用程序相关的执行信息数据只能从RM获得. 默认false.

2.Timeline store and state store configuration(timeline存储及状态存储配置)
yarn.timeline-service.store-class指定timeline存储类的类名,默认为"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore"
yarn.timeline-service.leveldb-timeline-store.path设置leveldb timeline存储路径及存储文件名,默认为 ${hadoop.tmp.dir}/yarn/timeline
yarn.timeline-service.leveldb-timeline-store.ttl-interval-ms leveldb timeline文件的存储周期,时间单位为milliseconds,默认300000,超时即删除。
yarn.timeline-service.leveldb-timeline-store.read-cache-size 以字节方式存储 leveldb timeline的非压缩块的读缓存的大小,默认设置为104857600
yarn.timeline-service.leveldb-timeline-store.start-time-read-cache-size 用于设置存储最近从leveldb timeline中读取entities的起始时间的缓存大小,默认10000
yarn.timeline-service.leveldb-timeline-store.start-time-write-cache-size 用于设置存储最近往leveldb timeline中写入entities的起始时间的缓存大小,默认10000
yarn.timeline-service.recovery.enabled 默认false
yarn.timeline-service.state-store-class 设置timeline store存储类的类名,默认设置为org.apache.hadoop.yarn.server.timeline.recovery.LeveldbTimelineStateStore
yarn.timeline-service.leveldb-state-store.path 为leveldb timeline状态存储设置存储路径和文件名

3.web和RPC配置
yarn.timeline-service.hostname 为timeline service Apllication配置主机名,默认0.0.0.0
yarn.timeline-service.address 设置timeline server用于启动RPC服务的地址,默认 ${yarn.timeline-service.hostname}:10200
yarn.timeline-service.webapp.address timeline service web应用程序的http地址,默认 ${yarn.timeline-service.hostname}:8188
yarn.timeline-service.webapp.https.address  timeline service web应用程序的https地址,默认 ${yarn.timeline-service.hostname}:8190
yarn.timeline-service.bind-host timeline server实际绑定的地址,如果设置了该参数,webAPP和RPC服务都将绑定该地址,而对应的端口号分别由 yarn.timeline-service.address和yarn.timeline-service.webapp.address指定。将该参数设置为0.0.0.0,将会监听到所有的接口,是非常有用的。
yarn.timeline-service.http-cross-origin.enabled 是否启动多源web服务(cross-origin).默认false
yarn.timeline-service.http-cross-origin.allowed-origins 逗号分隔的一组源,这是在需要cross-origin (CORS)的情况设置的,允许通配符(*)和多种模式,默认通配符*
yarn.timeline-service.http-cross-origin.allowed-methods 由逗号分隔的多种方法,这是在需要cross-origin (CORS)的情况设置的,默认 GET,POST,HEAD
yarn.timeline-service.http-cross-origin.allowed-headers 逗号分隔的一组headers,这是在需要cross-origin (CORS)的情况设置的, 默认X-Requested-With,Content-Type,Accept,Origin
yarn.timeline-service.http-cross-origin.max-age 一个预执行的请求可以被缓存的时间,这是在需要cross-origin (CORS)的情况设置的,默认1800
      上面的配置参数中,需要注意的是,http和https的选择时在TimelineClient设置的,它的设置是依据yarn平台的yarn.http.policy参数决定的,如果yarn中该参数设置的是HTTPS_ONLY或者HTTP_AND_HTTPS,那么选择https。

4.服务端高级配置
yarn.timeline-service.ttl-enable是否开启删除存储在timeline store中的超时数据的开关,默认false
yarn.timeline-service.ttl-ms timeline store中的数据的有效周期(毫秒),默认604800000
yarn.timeline-service.handler-thread-count 用于响应客户端RPC请求的处理程序的线程数量,默认10
yarn.timeline-service.client.max-retries 尝试将数据公开到timeline service上的尝试次数,默认30
yarn.timeline-service.client.retry-interval-mstimeline service 客户端的多次重试的间隔时间,默认1000ms

5.安全配置
在设置安全相关的参数之前,需要先将yarn.timeline-service.http-authentication.type配置为kerberos
yarn.timeline-service.http-authentication.type用于定义timeline server HTTP端点的认证,支持的值包括 simple / kerberos / #AUTHENTICATION_HANDLER_CLASSNAME#,默认simple
yarn.timeline-service.http-authentication.simple.anonymous.allowed 当选择认证方式为simple方式时,是否允许timeline server响应匿名用户的请求,默认true
yarn.timeline-service.principal 为timeline server定义Kerberos规则
yarn.timeline-service.keytab 为timeline server指定Kerberos密钥,unix系统中默认为/etc/krb5.keytab
yarn.timeline-service.delegation.key.update-interval 86400000 (即默认一天更新一次)
yarn.timeline-service.delegation.token.renew-interval 86400000
yarn.timeline-service.delegation.token.max-lifetime 604800000 (7天)
yarn.timeline-service.best-effort 在未能获得代理token的情况下,该参数为false时,表示判定程序运行失败,该参数值为true时,表示应用程序继续发布信息给timeline server;默认false

6.启动timeline服务和历史服务的基本配置
(即配置了如下的参数就可以启动timeline service)
[mw_shl_code=xml,true]<property>
  <description>Indicate to clients whether Timeline service is enabled or not.
  If enabled, the TimelineClient library used by end-users will post entities
  and events to the Timeline server.</description>
  <name>yarn.timeline-service.enabled</name>
  <value>true</value>
</property>

<property>
  <description>The setting that controls whether yarn system metrics is
  published on the timeline server or not by RM.</description>
  <name>yarn.resourcemanager.system-metrics-publisher.enabled</name>
  <value>true</value>
</property>

<property>
  <description>Indicate to clients whether to query generic application
  data from timeline history-service or not. If not enabled then application
  data is queried only from Resource Manager.</description>
  <name>yarn.timeline-service.generic-application-history.enabled</name>
  <value>true</value>
</property>[/mw_shl_code]

7.启动timeline服务的命令
在前面的参数得到正确配置的情况可以通过在linux shell执行如下命令启动Timeline server/history服务:
[mw_shl_code=shell,true]yarn timelineserver[/mw_shl_code]
如果想要以后台进程方式启动Timeline server/history,可以通过执行如下命令实现:
[mw_shl_code=shell,true]$HADOOP_YARN_HOME/sbin/yarn-daemon.sh start timelineserver[/mw_shl_code]

8.通过命令行访问generic-data
访问应用程序的通用历史数据,可以通过执行如下命令实现:
[mw_shl_code=shell,true]$ 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>[/mw_shl_code]

已有(1)人评论

跳转到指定楼层
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条