更改hadoop集群yarn的webui中的开始时间和结束时间为本地时间
yarn集群的webui地址为:http://rm:8088
执行任务后,任务的开始时间和结束时间都是utc时间,查看很不方便。
查找相关资料发现hadoop有补丁包,补丁地址:https://issues.apache.org/jira/browse/YARN-1998
补丁内容为:
Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js (revision 1591171) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/webapps/static/yarn.dt.plugins.js (working copy) @@ -78,7 +78,7 @@ if(data === '0'|| data === '-1') { return "N/A"; } - return new Date(parseInt(data)).toUTCString(); + return new Date(parseInt(data)).toLocaleString(); } // 'sort', 'type' and undefined all just use the number // If date is 0, then for purposes of sorting it should be consider max_int
所以只需要修改hadoop安装目录下的share/hadoop/yarn/hadoop-yarn-common-2.6.0.jar中的webapps/static/yarn.dt.plugins.js文件,将toUTCString()改为toLocaleString(),重启resourcemanager服务即可。