@emad rifai, If you want to submit the jobs directly via eclipse you need to set the below configs.
SparkConf conf = new SparkConf().setAppName("sparkForSMA").set("spark.master", "yarn-client") .set("spark.local.ip","<sandbox-ip>").set("spark.driver.host","localhost");
and if you want to submit a standalone app you may need to go with spark submit option which @Rajkumar Singh has shared.
ok thank you now it's work but i got this error ,
org.apache.hadoop.security.AccessControlException: Permission denied: user=A62, access=WRITE, inode="/user/A62/.sparkStaging/application_1464688052729_0002":hdfs:hdfs:drwxr-xr-x
@Sandeep Nemuri thank you for all your answers,
Do you know what cause the following error ?
org.apache.spark.SparkException: Yarn application has already ended! It might have been killed or unable to launch application master.
when I try to check the logs by the command yarn logs -applicationId i get
16/05/31 13:36:47 INFO impl.TimelineClientImpl: Timeline service address: http://sandbox.hortonworks.com:8188/ws/v1/timeline/ 16/05/31 13:36:48 INFO client.RMProxy: Connecting to ResourceManager at sandbox.hortonworks.com/10.24.244.31:8050 /app-logs/root/logs/application_1464699667428_0001does not exist. Log aggregation has not completed or is not enabled.