forked from ververica/sql-training
-
Notifications
You must be signed in to change notification settings - Fork 6
Python Table API环境准备
Hequn Cheng edited this page Nov 30, 2019
·
6 revisions
- Pycharm (方便编辑python脚本)
- Docker
Docker Compose 环境通过一个 YAML 文件来配置。默认的文件路径是 docker-compose.yml
。
通过 clone 我们的 Git 仓库可以获取该培训环境的配置文件。
git clone https://github.com/flink-china/sql-training.git
1.拉取镜像
cd sql-training/pyflink
docker-compose up -d
2.启动一个Python Table API的作业
cd sql-training/pyflink
docker-compose exec jobmanager ./bin/flink run -py /opt/examples/from_kafka_to_kafka.py
3.查看输出
docker-compose exec kafka kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic TempResults --from-beginning
4.停止job 请访问http://localhost:8081/#/overview ,并选择运行的job,然后点Cancle.
5.停止docker
docker-compose down
Apache Flink, Flink®, Apache®, the squirrel logo, and the Apache feather logo are either registered trademarks or trademarks of The Apache Software Foundation.