Skip to main content

How to Deploy Flink Service

tip
  • Flink service is an optional extension module of the HAP system. Users can decide whether to enable it based on their actual needs.
  • Before enabling, please ensure Docker version is 20.10.16 or above and the server has at least 8GB of free physical memory.
  • If the server deploying HAP has 32GB of memory, do not enable this module additionally, as it may worsen memory shortage and affect system availability. It's recommended to upgrade to 64GB before enabling.

For quick installation in standalone deployment mode, refer to the following instructions (Cluster deployment mode is relatively more complex; you may contact the HAP team for assistance):

  1. Download the Flink image (Offline package download)

    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.720
  2. Run the following command to check whether 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: /data/mingdao/script/docker-compose.yaml)

      1. Add the Flink service

          flink:
        image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.720
        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 the full modification example
        version: '3'

        services:
        app:
        image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-hap:7.2.3
        environment: &app-environment
        ENV_ADDRESS_MAIN: "https://hap.domain.com"
        ENV_APP_VERSION: "7.2.3"
        ENV_API_TOKEN: "******"
        ENV_FLINK_URL: "http://flink:8081" # Added: 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 service ---
        flink:
        image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.19.720
        entrypoint: ["/bin/bash"]
        command: ["/run.sh"]
        environment:
        ENV_FLINK_S3_ENDPOINT: "sc:9010"
        volumes:
        - ./volume/data/:/data/
    2. Restart services by running the following in the installation manager's extracted directory:

      bash service.sh restartall