当前位置:   article > 正文

flink配置historyserver_error org.apache.flink.runtime.webmonitor.history.

error org.apache.flink.runtime.webmonitor.history.historyserver [] - failed

flink版本1.9.1

1.编辑flink/conf/flink-conf.yaml ,搜索history,主要编辑如下

  1. #==============================================================================
  2. # HistoryServer
  3. #==============================================================================
  4. # The HistoryServer is started and stopped via bin/historyserver.sh (start|stop)
  5. #
  6. # # Directory to upload completed jobs to. Add this directory to the list of
  7. # # monitored directories of the HistoryServer as well (see below).
  8. # #jobmanager.archive.fs.dir: hdfs:///completed-jobs/
  9. jobmanager.archive.fs.dir: hdfs://beh/flink/
  10. #
  11. # # The address under which the web-based HistoryServer listens.
  12. # #historyserver.web.address: 0.0.0.0
  13. historyserver.web.address: 10.198.162.24
  14. #
  15. # # The port under which the web-based HistoryServer listens.
  16. # #historyserver.web.port: 8082
  17. historyserver.web.port: 8083
  18. # # Comma separated list of directories to monitor for completed jobs.
  19. # #historyserver.archive.fs.dir: hdfs:///completed-jobs/
  20. historyserver.archive.fs.dir: hdfs://beh/flink/
  21. # Interval in milliseconds for refreshing the monitored directories.
  22. #historyserver.archive.fs.refresh-interval: 10000
  23. historyserver.archive.fs.refresh-interval: 10000

2.参数释义

  1. jobmanager.archive.fs.dir:flink job运行完成后的日志存放目录
  2. historyserver.archive.fs.dir:flink history进程的hdfs监控目录
  3. historyserver.web.address:flink history进程所在的主机
  4. historyserver.web.port:flink history进程的占用端口
  5. historyserver.archive.fs.refresh-interval:刷新受监视目录的时间间隔(以毫秒为单位)。

3.注意jobmanager.archive.fs.dir要和historyserver.archive.fs.dir值一样:

实例:jobmanager.archive.fs.dir:为hdfs://beh/flink/

 historyserver.archive.fs.dir:为hdfs://beh/flink/jobs

job跑完出现如下:

然后查看history页面发现内容为空。

修改 historyserver.archive.fs.dir:为hdfs://beh/flink/后,再次运行job后如下:

然后查看history页面发现不仅吸现在的job,之前运行的也显示出来了。

注1:可以把其他集群的jobs日志拉过来,然后启动history进程进行页面展示。 

注2:启动过程可能报错:

  1. 2019-12-20 15:55:29,985 WARN org.apache.flink.runtime.webmonitor.history.HistoryServer - Failed to create Path or FileSystem fo
  2. r directory 'hdfs://beh/flink/'. Directory will not be monitored.
  3. org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Could not find a file system implementation for scheme 'hdfs'. The sc
  4. heme is not directly supported by Flink and no Hadoop file system to support this scheme could be loaded.
  5. at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:447)
  6. at org.apache.flink.core.fs.FileSystem.get(FileSystem.java:359)
  7. at org.apache.flink.core.fs.Path.getFileSystem(Path.java:298)
  8. at org.apache.flink.runtime.webmonitor.history.HistoryServer.<init>(HistoryServer.java:174)
  9. at org.apache.flink.runtime.webmonitor.history.HistoryServer.<init>(HistoryServer.java:137)
  10. at org.apache.flink.runtime.webmonitor.history.HistoryServer$1.call(HistoryServer.java:122)
  11. at org.apache.flink.runtime.webmonitor.history.HistoryServer$1.call(HistoryServer.java:119)
  12. at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
  13. at org.apache.flink.runtime.webmonitor.history.HistoryServer.main(HistoryServer.java:119)
  14. Caused by: org.apache.flink.core.fs.UnsupportedFileSystemSchemeException: Hadoop is not in the classpath/dependencies.
  15. at org.apache.flink.core.fs.UnsupportedSchemeFactory.create(UnsupportedSchemeFactory.java:58)
  16. at org.apache.flink.core.fs.FileSystem.getUnguardedFileSystem(FileSystem.java:443)
  17. ... 8 more
  18. 2019-12-20 15:55:29,988 ERROR org.apache.flink.runtime.webmonitor.history.HistoryServer - Failed to run HistoryServer.
  19. org.apache.flink.util.FlinkException: Failed to validate any of the configured directories to monitor.
  20. at org.apache.flink.runtime.webmonitor.history.HistoryServer.<init>(HistoryServer.java:183)
  21. at org.apache.flink.runtime.webmonitor.history.HistoryServer.<init>(HistoryServer.java:137)
  22. at org.apache.flink.runtime.webmonitor.history.HistoryServer$1.call(HistoryServer.java:122)

具体解决办法见:https://my.oschina.net/u/2338224/blog/3101005(敬佩大佬无私)

原因是在flink集群的CLASS_PATH下缺少了 HDFS相关的jar,其下载地址为(看个人hadoop和flink版本):

https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.6.5-9.0/

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/893996
推荐阅读
相关标签
  

闽ICP备14008679号