Process spark = new SparkLauncher()
.setAppResource("myApp.jar")
.setMainClass("com.aa.bb.app")
.setMaster("yarn")
.setDeployMode( "cluster")
.addAppArgs( data)
.launch();
This is how I executed my spark jar to yarn cluster. Here are some question below.
- Is this processing with a executor? ( 1 spark-submit per 1 yarn executor?)
- How should I executed multi spark job concurrently? (Where should I set dynamic allocation(spark.dynamicAllocation.enabled)?)
- Where should I set number of executor configuration? In java code? In yarn xml?
- If I set number of executor as 2, and process single job, one of executor will do nothing?
