Flink远程调试

Ideal配置

image.png

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9750

flikn/conf/flink-conf.yaml配置

在flink-conf.yaml中添加:

env.java.opts.jobmanager: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9750
env.java.opts.taskmanager: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9751

然后启动集群

./stop-cluster.sh
./start-cluster.sh

调试方法总结

1、在Ideal远程调试配置中设置对应的工程


image.png

2、在如下类中打下断点

standalone cluster模式下

  • jobmanager的入口类是org.apache.flink.runtime.entrypoint.StandaloneSessionClusterEntrypoint
  • taskmanager的入口类是org.apache.flink.runtime.taskexecutor.TaskManagerRunner, 找到main方法打上断点就可以开始调试了。

3、在flink中发布任务

../bin/flink run -c com.nianxl.flink.stream.WordAccount  frauddetection-0.1.jar --hostname=localhost --port=9752

你可能感兴趣的:(Flink远程调试)