当前位置:网站首页>Idea remote debugging jar submitted by spark submit
Idea remote debugging jar submitted by spark submit
2022-06-13 10:21:00 【Interest1_ wyt】
1、 Edit code
object WordCount {
def main(args: Array[String]): Unit = {
val sc = new SparkContext(new SparkConf().setAppName("WordCount "))
val rdd: RDD[String] = sc.makeRDD(List(
"spark hello", "hive", "hadoop hbase", "spark hadoop", "hbase"
))
val value: RDD[String] = rdd.flatMap(_.split(" "))
val mapRDD: RDD[(String, Int)] = value.map((_, 1))
val result: RDD[(String, Int)] = mapRDD.reduceByKey(_ + _)
result.collect().foreach(println)
}
}2、 open IDEA To configure , Configure remote connection


There are two main configurations , One is host, One is port. But I circled three places in the picture , The last place is to read the English description carefully , That string of commands is We need to copy and add to spark-submit In the parameters of the submit command Of .
3、 modify spark-submit, Add remote connection parameters
spark-submit \
--master spark://bigdata.node2:7077 \
--class test.wordcount.WordCount \
--num-executors 1 \
--driver-memory 499m \
--driver-cores 1 \
--executor-memory 499m \
--executor-cores 1 \
--driver-java-options -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8888 \
/opt/spark-jar/wyt01bigdata-1.0-SNAPSHOT.jar
You can see , We will IDEA Remote commands generated in -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8888 Added in spark Submit command . Here is a parameter to pay special attention to , about debug It is useful to , That's it suspend=y,y Indicates that the JVM Will pause waiting , until IDEA The debugger is connected to continue execution . If you set suspend=n, Then the remote service will not wait IDEA Connect .
In addition, there is another point to pay attention to , Because in the last step, we are remote debug It specifies host and port, So here we must Don't configure deploy-mode by cluster Cluster pattern . because The cluster mode is to start an application on a random machine , It is very likely that it will not start on the server we are listening to , So remote debug The deployment mode of is usually client( When we do not configure the deployment mode, the default is client)
边栏推荐
- Node-RED系列(二四):在Node-RED中使用mysql节点实现数据库的增删改查
- [51nod p3058] Xiao ming'ai set [set]
- Talk about the bottom playing method of C # method overloading
- Apple zoom! It's done so well
- Install Kubernetes 1.24
- Idea life extension plug-in
- WebRTC服务端工程实践和优化探索
- 上周热点回顾(6.6-6.12)
- Matplotlib 学习笔记
- How to calculate ASCII code value and how to calculate arccos value
猜你喜欢
![[51nod p2653] interval XOR [bit operation]](/img/3a/57c1a00edd3583e2c31fc4b8d47220.jpg)
[51nod p2653] interval XOR [bit operation]

Node red series (27): instructions for S7 node of the extension node

vivo大规模 Kubernetes 集群自动化运维实践
![[51nod 2493] sum of binary distances [bit operation]](/img/e9/8a8393f41cac7c323712c34f4d3e01.jpg)
[51nod 2493] sum of binary distances [bit operation]

Blue Bridge Cup group 2021a - two way sorting

【20220526】UE5.0.2 release d11782b

Thingsboard tutorial (21): save data after processing using message types and data processing nodes

Node-RED系列(二五):集成高德地图并实现3d地图和轨迹回放

基于SSM实现水果商城批发平台

电解电容、钽电容、普通电容
随机推荐
冗余码题型--后面加0的区别
架构师必备:系统容量现状checklist
Docker deployment MySQL
Node-RED系列(二四):在Node-RED中使用mysql节点实现数据库的增删改查
【工具链系列】 Notepad++
deepin系统中Qt5.12无法输入中文(无法切换中文输入法)解决办法
Introduction to knowledge map
全栈开发实战|SSM框架整合开发
Index query list injects MySQL and executes Oracle
Sunyuchen, head of Grenada delegation, attended the WTO MC12 and emphasized the development of digital economy
【图像去噪】基于matlab高斯+均值+中值+双边滤波图像去噪【含Matlab源码 1872期】
[51nod p3111] xiaoming'ai intercepts [Las]
Weekend book: power BI data visualization practice
C 11 more practical NAMEOF
IDEA 续命插件
June training (day 13) - two way linked list
微信小程序客服自动回复——PHP实现
Matlab hub motor analysis fuzzy PID control vertical vibration analysis
【云享新鲜】社区周刊·Vol.66-华为伙伴暨开发者大会2022精彩议程公布
Redis初始安装和使用【玩转华为云】