1自娩、Exception in thread "main" org.apache.spark.SparkException: Cluster deploy mode is not applicable to Spark shells.
具體報(bào)錯(cuò)信息.png
解決方案:
使用命令:
spark-shell --master yarn --deploy-mode client
2用踩、Caused by: java.lang.IllegalStateException: Cannot call methods on a stopped SparkContext.
part1.png
part2.png
原因:沒(méi)有關(guān)閉sc資源
解決:
sqlContext.sparkSession.close()
sc.stop()
詳細(xì)檢查寫(xiě)結(jié)束的位置渠退,寫(xiě)在最后,解決問(wèn)題脐彩。低級(jí)失誤
多加了最后一行即解決.png