How to Deploy Flink
- Flink services are an optional extension module of the HAP system, and users can choose whether to enable it based on their actual needs.
- Before enabling, please ensure that Docker version is 20.10.16 or above, and the server has at least 8GB of unused physical memory.
- If the server running HAP has 32GB of memory, do not enable this module additionally, as it may exacerbate memory insufficiency, affecting system availability. It is recommended to upgrade to 64GB or more before enabling.
For a quick installation in standalone deployment mode, follow the instructions below (Cluster deployment mode is relatively complex; you may contact the HAP team for assistance).
-
Download the image (Offline package download)
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.710 -
Execute the following command to check if the output contains a line with the keyword
start minio.docker logs $(docker ps | grep mingdaoyun-sc | awk '{print $1}') | grep minio- Output Detected
- No Output Detected
-
Modify the
docker-compose.yamlfile (default path is:/data/mingdao/script/docker-compose.yaml)-
Add the Flink service
flink:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.710
entrypoint: ["/bin/bash"]
command: ["/run.sh"]
environment:
ENV_FLINK_S3_ENDPOINT: "sc:9010"
volumes:
- ./volume/data/:/data/ -
Add the
ENV_FLINK_URLenvironment variable to the app serviceapp:
environment:
ENV_FLINK_URL: "http://flink:8081"Click to view a complete modification example
version: '3'
services:
app:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-hap:7.1.0
environment: &app-environment
ENV_ADDRESS_MAIN: "https://hap.domain.com"
ENV_APP_VERSION: "7.1.0"
ENV_API_TOKEN: "******"
ENV_FLINK_URL: "http://flink:8081" # New: Enable Flink service
ports:
- 8880:8880
volumes:
- ./volume/data/:/data/
- ../data:/data/mingdao/data
sc:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc:3.2.0
environment:
<<: *app-environment
volumes:
- ./volume/data/:/data/
command:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-command:node1018-python36
doc:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:2.0.0
# --- Newly added services ---
flink:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.710
entrypoint: ["/bin/bash"]
command: ["/run.sh"]
environment:
ENV_FLINK_S3_ENDPOINT: "sc:9010"
volumes:
- ./volume/data/:/data/
-
-
Restart the service. Execute the following command in the decompression path of the installation manager:
bash service.sh restartall
-
Modify the
docker-compose.yamlfile (default path is:/data/mingdao/script/docker-compose.yaml)-
Add the Flink service
flink:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.710
entrypoint: ["/bin/bash"]
command: ["/run.sh"]
environment:
ENV_FLINK_S3_ENDPOINT: "flink-minio:9000"
volumes:
- ./volume/data/:/data/ -
Add the flink-minio service to independently deploy a MinIO service for Flink to store related data
flink-minio:
container_name: flink-minio
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26Z
environment:
MINIO_ROOT_USER: "mdstorage"
MINIO_ROOT_PASSWORD: "eBxExGQJNhGosgv5FQJiVNqH"
volumes:
- ./volume/data/:/data/
command: minio server /data/flink-minio --console-address ":9001" -
Add the
ENV_FLINK_URLenvironment variable to the app serviceapp:
environment:
ENV_FLINK_URL: "http://flink:8081"Example
version: '3'
services:
app:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-hap:7.1.0
environment: &app-environment
ENV_ADDRESS_MAIN: "https://hap.domain.com"
ENV_APP_VERSION: "7.1.0"
ENV_API_TOKEN: "******"
ENV_FLINK_URL: "http://flink:8081" #Newly added
ports:
- 8880:8880
volumes:
- ./volume/data/:/data/
- ../data:/data/mingdao/data
sc:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc:3.2.0
environment:
<<: *app-environment
volumes:
- ./volume/data/:/data/
command:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-command:node1018-python36
doc:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:2.0.0
# Newly added content
flink:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.710
entrypoint: ["/bin/bash"]
command: ["/run.sh"]
environment:
ENV_FLINK_S3_ENDPOINT: "flink-minio:9000"
volumes:
- ./volume/data/:/data/
flink-minio:
container_name: flink-minio
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26Z
environment:
MINIO_ROOT_USER: "mdstorage"
MINIO_ROOT_PASSWORD: "eBxExGQJNhGosgv5FQJiVNqH"
volumes:
- ./volume/data/:/data/
command: minio server /data/flink-minio --console-address ":9001"
-
-
Download the MinIO image
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26ZIf the internet connection is unavailable, first download the offline image file, upload it to the server, and then complete the image file import. Offline image file download link:
https://pdpublic.mingdao.com/private-deployment/offline/mingdaoyun-minio-linux-amd64-RELEASE.2025-04-22T22-12-26Z.tar.gz -
Restart the service. Execute the following command in the decompression path of the installation manager:
bash service.sh restartall -
During the restart, open a new terminal and execute the following commands to create the Flink buckets:
docker exec -it flink-minio bash
mc alias set myminio http://127.0.0.1:9000 mdstorage eBxExGQJNhGosgv5FQJiVNqH
mc mb myminio/mdoc