运行Flink job 的集群一旦停止,只能取yarn或本地磁盘上查看日志,不可以再查看作业挂掉之前的运行的Web UI,很男清除作业在挂掉的那一刻到底发生了什么。Flink提供了历史服务器,用来在相应的Flink集群关闭后查询已完成的作业统计信息。
[server@hadoop102 ~]$ hadoop fs -mkdir -p /logs/flink-job
http://hadoop102:9870/explorer.html#/logs
[server@hadoop102 ~]$ cd /opt/module/flink-1.17.0/conf/
[server@hadoop102 conf]$ vim flink-conf.yaml
jobmanager.archive.fs.dir: hdfs://hadoop102/logs/flink-job/flink-job
# The address under which the web-based HistoryServer listens.
historyserver.web.address: hadoop102
# The port under which the web-based HistoryServer listens.
historyserver.web.port: 8082
# Comma separated list of directories to monitor for completed jobs.
historyserver.archive.fs.dir: hdfs://hadoop102/logs/flink-job/flink-job
# Interval in milliseconds for refreshing the monitored directories.
historyserver.archive.fs.refresh-interval: 5000
[server@hadoop102 conf]$ cd ..
[server@hadoop102 flink-1.17.0]$ pwd
/opt/module/flink-1.17.0
[server@hadoop102 flink-1.17.0]$ bin/historyserver.sh start
http://hadoop102:8082/#/overview











网友评论