Hi,
To launch spark application in cluster mode, you have to use spark-submit command. You cannot run yarn-cluster mode via spark-shell because when you will run spark application, driver program will be running as part application master container/process. So it is not possible to run cluster mode via spark-shell:
spark-submit –class com.df.SparkWordCount SparkWC.jar yarn-client
-> spark-submit –class com.df.SparkWordCount SparkWC.jar yarn-cluster