Giter Club home page Giter Club logo

flink-docker's Introduction

Flink in Docker

This is a Docker image appropriate for running Flink in Kuberenetes. You can also run it locally with docker-compose in which case you get two containers by default:

  • flink-jobmanager - runs a Flink Job Manager in cluster mode and exposes a port for Flink and a port for the WebUI.
  • flink-taskmanager - runs a Flink Task Manager and connects to the Flink Job Manager via static DNS name flink-jobmanager.

The Docker setup is heavily influenced by docker-flink

Usage

Build

You only need to build the Docker image if you have changed Dockerfile or the startup shell script, otherwise skip to the next step and start using directly.

To build, get the code from Github, change as desired and build an image by running make

Run locally

Get the docker-compose.yml from Github and then use the following snippets

Start JobManager and TaskManager

docker-compose up -d will start a Job Manager with a single Task Manager in background.

Scale TaskManagers

docker-compose scale flink-taskmanager=5 will scale to 5 Task Managers.

Deploy and Run a Job
  1. Copy the Flink job JAR to the Job Manager

docker cp /path/to/job.jar $(docker ps --filter name=flink-jobmanager --format={{.ID}}):/job.jar to

  1. Copy the data to each Flink node if necessary
for i in $(docker ps --filter name=flink --format={{.ID}}); do
  docker cp /path/to/data.csv $i:/data.csv
done
  1. Run the job

docker exec -it $(docker ps --filter name=flink-jobmanager --format={{.ID}}) flink run -c <your_job_class> /job.jar [optional params]

where optional params could for example point to the dataset copied at the previous step.

Accessing Flink Web Dashboard

Navigate to http://localhost:8081

Stop Flink Cluster

docker-compose down shuts down the cluster.

Contribution

You are very welcome to open an issue or a PR on Github.

flink-docker's People

Contributors

makyol avatar melentye avatar

Watchers

 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.