美文网首页
spark报错

spark报错

作者: Rainysong | 来源:发表于2020-08-21 18:37 被阅读0次

1、Exception in thread "main" org.apache.spark.SparkException: Cluster deploy mode is not applicable to Spark shells.


具体报错信息.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

原因:没有关闭sc资源
解决:
sqlContext.sparkSession.close()
sc.stop()

详细检查写结束的位置,写在最后,解决问题。低级失误

多加了最后一行即解决.png

相关文章

网友评论

      本文标题:spark报错

      本文链接:https://www.haomeiwen.com/subject/sjkpjktx.html