idea远程调试spark任务

1.在idea 新建Remote
idea远程调试spark任务
2.spark任务提交
spark2-submit --master yarn --deploy-mode client --class com.my.base.TestDemo --driver-memory 4g --executor-memory 20g --executor-cores 2 --num-executors 10 --driver-java-options “-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787” ./RemoteDemo-jar-with-dependencies.jar
注意:端口号要一致,都是8787
会处于监听状态,如图所示:
idea远程调试spark任务
3.debug方式运行本地main方法