TEZ UI部署
参考官方Tez UI部署文档;
修改集群相关配置,并在tomcat容器下运行Tez UI的war包(需要修改Tez UI下的config.js文件,填写正确的timeline,rm地址)
配置调整
在yarn-site增加配置项
yarn.timeline-service.acl.enabled=true
yarn.timeline-service.delegation-token.max-lifetime=86400000
yarn.timeline-service.entity-group-fs-store.acl-enable=true
yarn.timeline-service.generic-application-history.enabled=true
yarn.timeline-service.http-authentication.enabled=true
调整tez-zite配置
yarn.timeline-service.enabled=true
tez.am.history.logging.enabled=true
tez.dag.history.logging.enabled=true
tez.history.logging.service.class=org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService
yarn.timeline-service.hostname=http://xxx.xxx.xxx.xxx:xx
需要重启Timeline,RM服务,Tez服务
权限问题及解决
完成配置修改和服务重启后,集群已经由任务在运行或完成,可以通过如下地址进行验证:
http://timelineServer:8188/ws/v1/timeline/TEZ_DAG_ID?limit=12
返回类似如下数据:
{
"entities": [
{
"entitytype": "TEZ_DAG_ID",
"entity": "dag_17501234174_0011_1",
"starttime": 17501234174,
.....
}
.....
]
}
如果返回了一个空的数据,如:
{
"entities": []
}
则先看下yarn.acl.enable,yarn.admin.acl两个配置,确认是否开启的acl,及配置了正确的账号;
如yarn.acl.enable=true;则需要使用yarn.admin.acl中配置的账号进行接口调用(如yarn.admin.acl=hive,yarn)
http://timelineServer:8188/ws/v1/timeline/TEZ_DAG_ID?limit=12&user.name=yarn
正常来说可以获取到集群上运行的任务数据了。
TEZ UI界面查看
浏览器打开部署的tez ui(默认端口9998),http://ip:9998/tez-ui
如果页面上查看不到tez的任务数据,则应该也是acl认证问题,tez-ui默认使用了匿名用户方位;
处理方式,启动tez-ui时,设置固定身份,在java启动命令中添加:-Duser.name=$TEZ_UI_USER
以tomcat启动为例:
修改catalina.sh(文件在tomcat的bin目录下) 启动脚本;
添加加JAVA_OPTS="$JAVA_OPTS -Duser.name=yarn"
如果添加启动参数,tez ui的界面还是不能获取数据,则可以直接修改项目的js文件(tez-ui.js),在发送加载请求时,强制添加"user.name"参数