Skip to content

faisalm1997/apache-flink-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Apache Flink Quickstart

Overview

This guide helps you quickly set up and run an Apache Flink streaming application on your local machine.


Prerequisites

  • Java 11 or higher
    Install with Homebrew:

    brew install openjdk@11
    echo 'export PATH="/usr/local/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc
    echo 'export JAVA_HOME="/usr/local/opt/openjdk@11"' >> ~/.zshrc
    source ~/.zshrc
  • Python3 (if using PyFlink)

  • Docker (this is optional for running flink inside containers)

Installation and Usage

  1. Downloading Flink
wget https://dlcdn.apache.org/flink/flink-2.1.0/flink-2.1.0-bin-scala_2.12.tgz
tar -xzf flink-2.1.0-bin-scala_2.12.tgz
cd flink-2.1.0
  1. Starting Flink locally
./bin/start-cluster.sh
  1. Running a sample job
./bin/flink run examples/streaming/WordCount.jar
  1. Verifying the output logs
tail log/flink-*-taskexecutor-*.out
  1. Viewing activity in the Flink UI
http://localhost:8081/

Using PyFlink to run a sample job

  1. Install PyFlink
pip install apache-flink
  1. Run a PyFlink job
python examples/python/word_count.py
  1. Stopping Flink cluster
./bin/stop-cluster.sh

Image of Flink UI when submitting a job

alt text

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published