✨
Dataflint for Spark
Github
  • πŸ‘‹Welcome to DataFlint
  • Overview
    • ✨Our Features
    • πŸ—ΊοΈHow It Works
    • πŸ”“Security & Stability
    • πŸ” Supported Versions
    • βͺRelease Notes
  • Getting Started
    • ⭐Install on Spark
    • 🧱Install on DataBricks
    • πŸ“ͺInstall on Spark History Server
    • 🏹Usage
  • ⛓️Integrations
    • 🧊Apache Iceberg
  • 🏹Advanced
    • πŸ’°DCU calculation
    • ⏰Alerts
  • πŸ‘¨β€πŸ’ΌSaaS
    • πŸ”’SaaS Security & Stability
Powered by GitBook
On this page

Last updated 20 days ago

Dataflint is implementing as a file system plugin to be loaded to Spark History Server

Spark History Server Installation Script

Alternative installation

Instead of environment variable, you can download the jar to the $SPARK_HOME/jars folder so it will be loaded automatically to spark history server

How it works

The jar includes a history server plugin that add the DataFlint UI when a spark UI app is being loaded from logs.

History Server does not support packages loading (Apache Ivy) like live spark app, so you need to download the jar and load it to the history server manually

Install on EMR history server

This method does not work on persistent EMR history server, and for the on-cluster the default AWS proxy currently doesn't work correctly so you need to do port-forward

Via bootstrap script

Via SSH

Connect to your EMR cluster via ssh and run the following commands:

From EMR terminated cluster

Go to your EMR terminated server, Applications tab and press "Spark History Server" to open the persistant history server

Press the "Download" button on the relevant application or applications

Running spark history server on your machine

In order to run the spark history server on your machine you need first to:

  1. Have java (version 8 or 11) installed on your machine, and set up JAVA_HOME

  2. Set up the SPARK_HOME environment variable to where you extracted Spark

Extract the zip file to /tmp/spark-events, and then run the locally on your machine

Download spark from and extract the downloaded zip somewhere on your machine

  1. Getting Started

πŸ“ͺInstall on Spark History Server

#!/bin/bash

cd $SPARK_HOME
DATAFLINT_VERSION="0.4.0"
# Step 1: Download the jar to the history server machine

wget -O /tmp/spark_2.12-$DATAFLINT_VERSION.jar https://repo1.maven.org/maven2/io/dataflint/spark_2.12/$DATAFLINT_VERSION/spark_2.12-$DATAFLINT_VERSION.jar

# Step 2: add dataflint jar to classpath
export SPARK_DAEMON_CLASSPATH=/tmp/spark_2.12-$DATAFLINT_VERSION.jar

# step 3: if history server already running, stop and start it again
./sbin/stop-history-server.sh
./sbin/start-history-server.sh
sudo su
DATAFLINT_VERSION="0.4.0"
if sudo grep isMaster /mnt/var/lib/info/instance.json | grep true;
then        
    sudo wget \
        -O /usr/lib/spark/jars/spark_2.12-$DATAFLINT_VERSION.jar \
        https://repo1.maven.org/maven2/io/dataflint/spark_2.12/$DATAFLINT_VERSION/spark_2.12-$DATAFLINT_VERSION.jar
fi
sudo su
DATAFLINT_VERSION="0.4.0"
sudo wget \
-O /usr/lib/spark/jars/spark_2.12-$DATAFLINT_VERSION.jar \
https://repo1.maven.org/maven2/io/dataflint/spark_2.12/$DATAFLINT_VERSION/spark_2.12-$DATAFLINT_VERSION.jar

sudo systemctl stop spark-history-server.service
sudo systemctl start spark-history-server.service
Install on Spark History Server
https://spark.apache.org/downloads.html
Location of the On-Cluster Spark History Server link you should use