【发布时间】:2017-02-28 11:37:31
【问题描述】:
启动dfs、yarn和spark后,我在master主机的spark根目录下运行这些代码:
MASTER=yarn ./bin/run-example ml.LogisticRegressionExample \ data/mllib/sample_libsvm_data.txt
其实我是从 Spark 的 README 中得到这些代码的,这里是 GitHub 上关于 LogisticRegressionExample 的源代码:https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/ml/LogisticRegressionExample.scala
然后出现错误:
Exception in thread "main" org.apache.spark.sql.AnalysisException: Path does not exist: hdfs://master:9000/user/root/data/mllib/sample_libsvm_data.txt;
首先,我不知道为什么是hdfs://master:9000/user/root,我确实将namenode的IP地址设置为hdfs://master:9000,但是spark为什么选择/user/root?
然后,我在集群的每台主机上都创建了一个目录/user/root/data/mllib/sample_libsvm_data.txt,希望spark能找到这个文件。但同样的错误再次发生。请告诉我如何解决它。
【问题讨论】:
标签: hadoop apache-spark hadoop-yarn