在IDEA中执行Flink应用时如何访问Dashboard?
在Flink的local模式、standalone模式下 , 我们可以访问集群中jobmanager节点默认的8081端口 , 就可以打开Flink Dashboard界面 。
在IDEA中执行Flink应用时 , 是否也可以显示Dashboard界面么?
可以 , 但是需要添加flink-runtime-web 包的支持 。
下面具体介绍如何查看dashboard 。
一、添加依赖包首先 , 需要在Flink项目的pom文件中 , 添加如下依赖项:
flink-runtime-web_${scala.binary.version}
compile
二、运行Flink应用查看web frontend端口号在IDEA中启动Flink应用 , 查看启动日志如下:
23:05:06,130 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint - Rest endpoint listening at localhost:43777
23:05:06,132 INFO org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedLeaderService - Proposing leadership to contender http://localhost:43777
23:05:06,136 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint - Web frontend listening at http://localhost:43777.
23:05:06,136 INFO org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint - http://localhost:43777 was granted leadership with leaderSessionID=fc988d7f-7780-4849-9931-fbbade84cc6f
23:05:06,136 INFO org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedLeaderService - Received confirmation of leadership for leader http://localhost:43777 , session=fc988d7f-7780-4849-9931-fbbade84cc6f
23:05:06,154 INFO org.apache.flink.runtime.rpc.akka.AkkaRpcService - Starting RPC endpoint for org.apache.flink.runtime.resourcemanager.StandaloneResourceManager at akka://flink/user/rpc/resourcemanager_1 .
23:05:06,173 INFO org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedLeaderService - Proposing leadership to contender LeaderContender: DefaultDispatcherRunner
23:05:06,173 INFO org.apache.flink.runtime.highavailability.nonha.embedded.EmbeddedLeaderService - Proposing leadership to contender LeaderContender: StandaloneResourceManager
23:05:06,176 INFO org.apache.flink.runtime.resourcemanager.StandaloneResourceManager - ResourceManager akka://flink/user/rpc/resourcemanager_1 was granted leadership with fencing token a88541b673479191b1fb0ec4a3154cdf
23:05:06,178 INFO org.apache.flink.runtime.minicluster.MiniCluster - Flink Mini Cluster started successfully
通过上面的日志 , 可以看到Flink dashboard监听地址如下:
http://localhost:43777
在浏览器中访问上述URL , 就可以访问Flink Dashboard界面了 。
文章插图
查看正在运行的running jobs:Flink Streaming Word Count by Scala , 如图所示 。
【在IDEA中执行Flink应用时如何访问Dashboard?】其中 , Parallelism(并行度)=8 , 默认并行度和CPU核心数一致 。
文章插图
- 加速编程效率,你不知道的IDEA功能设置
- IntelliJ IDEA 如何设置自动下载源代码和文档
- DispatcherServlet执行流程
- 推荐一款IDEA神器!一键查看Java字节码以及其他类信息
- IDEA中添加Scala语言的Maven flink模板
- 从 Storm 迁移到 Flink,美团外卖实时数仓建设实践
- 「每日idea分享」纯正口音AI英语老师;在线评估生育健康
- IDEA 常用快捷键
- 联想IdeaPad14s 2020款为何是国民好本
- 新功能Chrome Actions:直接在地址栏执行清理缓存等操作