py4j.protocol.Py4JJavaError错误

py4j.protocol.Py4JJavaError: An error occurred while calling o30.toDebugString.
: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: hdfs://192.168.1.84:9000/user/root/shakespeare.txt

这里写图片描述

原因:

 text = sc.textFile("shakespeare.txt")

spark默认去hdfs寻找,然而我的放在本地,应该改为:

 text = sc.textFile("file:///root/shakespeare.txt")

猜你喜欢

转载自blog.csdn.net/eat_shopping/article/details/78251442