跳到主要内容

如何启用数据集成功能

数据集成是 HAP 系统中的扩展模块,用户可自主选择是否启用,启用之前请确保 Docker 版本在 20.10.16 及以上,服务器空余物理内存 8G+

单机部署模式快速安装可参考如下:(集群部署模式下相对复杂,可联系 HAP 团队协助完成)

  1. 下载镜像(离线包下载

    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.17.1.510
  2. 修改 docker-compose.yaml(默认路径为:/data/mingdao/script/docker-compose.yaml),主要涉及2部分调整

    1. 添加 flink 服务

      flink:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.17.1.510
      entrypoint: ["/bin/bash"]
      command: ["/run.sh"]
      volumes:
      - ./volume/data/:/data/

      注意:如果 docker logs $(docker ps | grep '\-sc' | awk '{print $1}') | grep minio 有输出结果,则需要在 flink 服务增加 ENV_FLINK_S3_ENDPOINT 环境变量

      flink:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.17.1.510
      entrypoint: ["/bin/bash"]
      command: ["/run.sh"]
      environment:
      ENV_FLINK_S3_ENDPOINT: "sc:9010"
      volumes:
      - ./volume/data/:/data/
    2. app 服务添加 ENV_FLINK_URL 环境变量

      app:
      environment:
      ENV_FLINK_URL: "http://flink:8081"
      示例
      version: '3'

      services:
      app:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-community:5.2.3
      environment: &app-environment
      ENV_ADDRESS_MAIN: "https://hap.domain.com"
      ENV_APP_VERSION: "5.2.3"
      ENV_API_TOKEN: "******"
      ENV_FLINK_URL: "http://flink:8081" #新增
      ports:
      - 8880:8880
      volumes:
      - ./volume/data/:/data/
      - ../data:/data/mingdao/data

      sc:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc:2.0.0
      environment:
      <<: *app-environment
      volumes:
      - ./volume/data/:/data/

      command:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-command:node1018-python36
      environment:
      <<: *app-environment

      doc:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:1.2.0
      environment:
      ENV_FILE_INNER_URI: "app:8880"

      # 新增
      flink:
      image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-flink:1.17.1.510
      entrypoint: ["/bin/bash"]
      command: ["/run.sh"]
      environment:
      ENV_FLINK_S3_ENDPOINT: "sc:9010"
      volumes:
      - ./volume/data/:/data/
  3. 重启 HAP 微服务