Skip to main content

How to Deploy Flink

tip
  • 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).

  1. Download the image (Offline package download)

    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.710
  2. 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
    1. Modify the docker-compose.yaml file (default path is: /data/mingdao/script/docker-compose.yaml)

      1. 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/
      2. Add the ENV_FLINK_URL environment variable to the app service

        app:
        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/
    2. Restart the service. Execute the following command in the decompression path of the installation manager:

      bash service.sh restartall