Spark is not running in local mode, therefore the checkpoint directory must not be on the local……

待我称王封你为后i 2022-10-14 05:28 137阅读 0赞

Spark执行的时候报错:

  1. WARN spark.SparkContext: Spark is not running in local mode, therefore the checkpoint directory must not be on the local filesystem. Directory 'file:///home/checkpointData' appears to be on the local filesystem.

简单翻译下:Spark没有在本地模式下运行,因此检查点目录不能在本地文件系统上。

也就是说,Spark应用跑在集群模式下,checkpoint directory是不可以设置在本地文件系统的。

在HDFS上创建一个目录:

  1. hdfs dfs -mkdir sparkCheckpoint
  2. hdfs dfs -chmod 777 sparkCheckpoint
  3. hdfs dfs -ls

然后在spark里面配置一下就可以了。

  1. sc.setCheckpointDir("hdfs://ns1/tmp/username/sparkCheckpoint")

发表评论

表情:
评论列表 (有 0 条评论,137人围观)

还没有评论,来说两句吧...

相关阅读