Giter Site home page Giter Site logo

itmo_big_data_hw3's Introduction

HW03: Streaming (kafka+flink)

Troubleshooting

  • First namenode run should be with formatting. See comments in docker-compose.yml
  • If jobmanager fails with error "cannot run /opt/pyflink/venv/bin/python then delete your local venv"

1. Start service

docker compose build

docker compose up -d

mkdir -p tmp/checkpoints/logs/

sudo chmod -R 777 tmp/checkpoints/logs/

docker compose ps

Check interface at http://localhost:8081/#/overview

2. Create kafka topics

docker compose exec kafka kafka-topics.sh --bootstrap-server kafka:9092 --create --topic itmo2023 --partitions 3

docker compose exec kafka kafka-topics.sh --bootstrap-server kafka:9092 --create --topic itmo2023-processed --partitions 3

docker compose exec kafka kafka-topics.sh --bootstrap-server kafka:9092 --create --topic itmo2023-tumbling-max --partitions 3

docker compose exec kafka kafka-topics.sh --bootstrap-server kafka:9092 --create --topic itmo2023-sliding-max --partitions 3

docker compose exec kafka kafka-topics.sh --bootstrap-server kafka:9092 --create --topic itmo2023-session-max --partitions 3

3. Run scripts (parts are not sequentional)

  • Part 1

Choose checkpoint destination in .env

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/consumers/itmo_processed_1/itmo2023_processed.py

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/producers/itmo2023/producer.py

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/jobs/device.py

Photo of local checkpoint storage Photo of hdfs checkpoint storage Photo of hdfs checkpoint storage Photo of hdfs checkpoint storage

See checkpoints configuration

  • Part 2
docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/producers/itmo2023/producer.py

# 1
docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/consumers/itmo_processed_1/itmo2023_tumbling_max.py

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/jobs/tumbling_max.py

# 2
docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/consumers/itmo_processed_1/itmo2023_sliding_max.py -d

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/jobs/sliding_max.py -d

# 3
docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/consumers/itmo_processed_1/itmo2023_session_max.py -d

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/jobs/session_max.py -d

See implementations tumbling, sliding, session

  • Part 3
docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/producers/itmo2023/producer.py -d

docker compose exec jobmanager ./bin/flink run -pyfs file:///opt/pyflink -py /opt/pyflink/consumers/itmo_1/itmo2023_failing.py -d

See backoff implementation and usage

itmo_big_data_hw3's People

Contributors

rytuo avatar nickdndev 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.