IDEA 远程调试设置 Remote Applicate
export SPARK_MASTER_OPTS=" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=10000"
export SPARK_WORKER_OPTS=" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=10001"
spark.executor.extraJavaOptions= - Xdebug - Xrunjdwp : transport= dt_socket,server= y,suspend= y,address= 10002
def sparkContext (): SparkContext = {
val conf = new SparkConf ().setAppName(appName).setMaster(master)
conf.set(" spark.eventLog.enabled" ," true" )
// conf.set("spark.ui.port","10002")
conf.set(" spark.history.fs.logDirectory" ," hdfs://standalone.com:9000/spark/log/historyEventLog" )
conf.set(" spark.eventLog.dir" ," hdfs://standalone.com:9000/spark/log/eventLog" )
// executor debug,是在提交作的地方读取
conf.set(" spark.executor.extraJavaOptions" ," -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=10002" )
conf.setJars(Array (" /opt/n_001_workspaces/bigdata/spark-scala-maven/target/spark-scala-maven-1.0-SNAPSHOT.jar" ))
val sc = new SparkContext (conf)
// 设置日志级别
// sc.setLogLevel("ERROR")
sc
}
spark-submit \
--class com.opensource.bigdata.spark.standalone.RunTextFileMkString2 \
--master spark://standalone:7077 \
--executor-memory 1G \
--total-executor-cores 100 \
--driver-java-options " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=10002" \
/root/temp/spark-scala-maven-1.0-SNAPSHOT.jar \