Giter Site home page Giter Site logo

spark-kubernets-cassandra_project_cpsc531's Introduction

Airline Performance and Flight Delay Analysis ๐Ÿ›ซ๐Ÿ“Š

This project leverages the power of Kubernetes, Apache Spark, and Cassandra to analyze airline performance and flight delays. We use .parquet files as our primary data format.

Architecture Diagram

architecture.jpeg

Prerequisites ๐Ÿ“‹

Ensure you have kubectl, minikube, and helm installed on your local machine to execute the steps outlined below.

Setup Instructions ๐Ÿ› 

Step 1: Install Necessary Libraries

Run the following bash script to install all required libraries:

./requirements.sh

Step 2: Set Up Kubernetes Cluster

Initialize the Minikube cluster with specified resources:

minikube start --cores=8 --memory=5120

Step 3: Interact with Kubernetes Cluster

Utilize kubectl to interact with your cluster. Check all pods:

kubectl get po -A

For a GUI overview, launch the Minikube dashboard:

minikube dashboard

Step 4: Set Up Cassandra in Kubernetes

Navigate to the config folder and execute the script to create Cassandra pods and stateful set:

cd config
sh create-cassandra-pod.sh

Step 5: Install Spark

From the config directory, use Helm to install Spark using the custom values from sparkValues.yaml:

helm install my-spark bitnami/spark --version 8.1.6 -f sparkValues.yaml

Step 6: Import Data and Application to Spark

Copy the application JAR and .parquet data to the Spark master pod:

kubectl cp [path-to-the-jarfile] default/my-spark-master-0:/opt/bitnami/spark
kubectl cp [path-to-the-parquet-data] default/my-spark-master-0:/opt/bitnami/spark

Step 7: Submit Spark Job

Submit the Spark job to process the flight data:

./bin/spark-submit \
--class org.example.FlightDelayAnalysis \
--master spark://my-spark-master-0.my-spark-headless.default.svc.cluster.local:7077 \
--num-executors 2 \
--driver-memory 1g \
--driver-cores 1 \
--executor-memory 3g \
--executor-cores 3 \
FlightDelayAnalysis-1.0-SNAPSHOT.jar "10.244.0.6" "9042"

Step 8: Analysis Workflow

The application performs the following steps:

  1. Establishes connection with Spark and Cassandra.
  2. Reads the .parquet file into a Spark DataFrame.
  3. Conducts ETL operations on the DataFrame to prepare it for analysis.
  4. Performs analysis and stores the results back into Cassandra.

Step 9: Visualize Results

Use Cassandra port forwarding to access Cassandra from outside the cluster, then run a Python script to visualize the results using Matplotlib:

# Example Python script to plot data
python plot_results.py

Result

graphs.png

Conclusion ๐ŸŽ‰

This project sets up a robust data processing pipeline using Kubernetes, Spark, and Cassandra to analyze and visualize airline performance and delay patterns effectively. For feedback and contributions, feel free to open an issue or pull request.

spark-kubernets-cassandra_project_cpsc531's People

Contributors

sanjyot242 avatar sumitrodrigues avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.