Posts: 6
Registered: ‎10-18-2016
Accepted Solution

Spark produces no logs



I am running CDH 5.12 QuickStart VM with package installation (no parcels, and no CM).


I can't get Spark to produce application logs in the designated HDFS directory, and consequently nothing is displayed by Spark History Server.  My Spark jobs run as part of an Oozie workflow, but no Spark logs are produced.


My  /etc/spark/conf/spark-defaults.conf contains:


spark.eventLog.enabled            true
spark.eventLog.dir                hdfs:///user/spark/applicationHistory
spark.history.fs.logDirectory     hdfs:///user/spark/applicationHistory
spark.yarn.historyServer.address  http://quickstart.cloudera:18088


The HDFS log directory has the following permissions:

$sudo -u hdfs  hadoop fs -ls /user/spark
Found 1 items
drwxrwxrwt   - spark spark          0 2017-09-06 13:31 /user/spark/applicationHistory

The Oozie Spark Task runs on Yarn, and it is defined as:

<spark xmlns="uri:oozie:spark-action:0.1">


The Oozie workflow runs correctly, and I can see the logs in the Yarn History Server, and in Hue's Oozie Dashboard. However the Spark History Server shows this:


History Server

    Event log directory: hdfs:///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. 

The HDFS directory /user/spark/applicationHistory is empty.


I have looked everywhere in the documentation, specifically here:,  but I have not been able to find a solution, please help.


Thanks in advance,

Alex Soto



Posts: 6
Registered: ‎10-18-2016

Re: Spark produces no logs

In case it helps others:


The file /etc/spark/conf/spark-defaults.conf  is not used by Oozie Spark Actions by default.  In order to tell Oozie Spark Action to use this file, I had to add this to /etc/oozie/conf/oozie-site.xml 



Now I can see the logs in the Spark History Server.  I wonder why this should be the default.

Posts: 6
Registered: ‎10-18-2016

Re: Spark produces no logs

Not sure if this it the correct solution.  I am not able to see my Tasks logs, I only see the Spark logs (driver and tasks) but not my application logs.  Anything I log from within a closure is not whowing.  I tried configuring the file in the /etc/spark/conf/ but it doesn't seem to make a difference.  The only sucess I had so far was to get the History Server to show something.