我在3节点集群上安装了CDH 5.4.7。在Spark上运行第一个作业后,我检查了应用程序历史记录页面。它写成如下
Event log directory: hdfs://****:8020/user/spark/applicationHistory
No completed applications found!
Did you specify the correct logging directory? Please verify your setting of
spark.history.fs.logDirectory and whether you have the permissions to access
it. It is also possible that your application did not run to completion or
did not stop the SparkContext.
我检查了HDFS,发现/user/spark/applicationHistory
已经存在。但是该目录中没有条目。这意味着没有写入日志。我搜索了cloudera文档页面,并在以下链接中找到了文章Managing the Spark History Server
如上所述,我添加了Spark History Server并启动了它。为我的用户执行以下两个命令
$ sudo -u hdfs hadoop fs -chown -R spark:spark /user/spark
$ sudo -u hdfs hadoop fs -chmod 1777 /user/spark/applicationHistory
但是,当我尝试执行以下命令时,它会出现no such file or directory
错误
$ cp /etc/spark/conf/spark-defaults.conf.template /etc/spark/conf/spark-defaults.conf
所以,我去了路径/etc/spark
并列出了其中的文件。它显示了类似的东西
conf -> /etc/alternatives/spark-conf
我都不能创建名为conf
的目录,因为它已经存在,我也无法将目录更改为/etc/spark/conf
同样service spark-history-server start
命令会出现unrecognized service
错误。
请帮忙!提前致谢
答案 0 :(得分:1)
我在Cloudera Quickstart VM 5.12.0映像上遇到了同样的问题,并且能够按照以下步骤解决问题:
$ sudo service spark-history-server stop
$ sudo -u hdfs hadoop fs -chown -R spark:spark / user / spark
$ sudo -u hdfs hadoop fs -chmod 777 / user / spark / applicationHistory
spark.eventLog.enabled =真
spark.eventLog.dir = HDFS://quickstart.cloudera:8020 /用户/火花/ applicationHistory
spark.yarn.historyServer.address = http://quickstart.cloudera:18088
$ sudo service spark-history-server start
希望它对其他人有用。