This project is configured to enable the Spark History Server for viewing completed applications.
-
Make sure the
spark-events
directory exists in your project root:mkdir spark-events
-
Start the Spark cluster:
docker-compose down ; docker-compose up -d
-
Submit your Spark job with event logging enabled (inside the container):
spark-submit \ --conf spark.jars.ivy=/opt/bitnami/spark/tmp/.ivy2 \ --conf spark.local.dir=/opt/bitnami/spark/tmp/spark \ --conf spark.eventLog.enabled=true \ --conf spark.eventLog.dir=/opt/bitnami/spark/tmp/spark-events \ /tmp/test_spark_script.py
spark-submit --conf spark.jars.ivy=/opt/bitnami/spark/tmp/.ivy2 --conf spark.local.dir=/opt/bitnami/spark/tmp/spark --conf spark.eventLog.enabled=true --conf spark.eventLog.dir=/opt/bitnami/spark/tmp/spark-events /tmp/test_spark_script.py
-
Access the Spark History Server UI at: http://localhost:18080
Completed applications will appear in the History Server UI after your jobs finish.
- If you see errors about Ivy or local directories, make sure you are using the provided
docker-compose.yml
and the correct submit command above. - If the History Server UI does not show completed jobs, check that event logs are being written to the
spark-events
directory.