docker 部署 Seatunnel 和 Seatunnel Web

docker 部署 Seatunnel 和 Seatunnel Web

说明:

  1. 部署方式前置条件,已经在宿主机上运行成功
  2. 运行文件采用挂载宿主机目录的方式部署
  3. SeaTunnel Engine 采用的是混合模式集群

编写Dockerfile并打包镜像

  • Seatunnel
FROM openjdk:8
WORKDIR /opt/seatunnel/
CMD sh bin/seatunnel-cluster.sh -d

docker build -t seatunnel:2.3.3 .

  • Seatunnel-Web
FROM openjdk:8
WORKDIR /opt/seatunnel-web/
CMD sh bin/seatunnel-backend-daemon.sh start

docker build -t seatunnel-web:1.0.1 .

修改配置文件

  • $SEATUNNEL_HOME/config/hazelcast-client.yaml
    hazelcast-client.network.cluster-members.ip -> 修改为 seatunnel (与seatunnel 服务的 container_name一致即可)
  • $SEATUNNEL_WEB_HOME/config/hazelcast-client.yaml
    hazelcast-client.network.cluster-members.ip -> 修改为 seatunnel (与seatunnel 服务的 container_name一致即可)
  • $SEATUNNEL_WEB_HOME/bin/seatunnel-backend-daemon.sh
    修改为非后台启动,方便 docker 检测日志 在这里插入图片描述

编写DockerCompose 并运行

version: '3.9'

services:
    seatunnel:
      image: seatunnel:2.3.3
      container_name: seatunnel
      environment:
	    ## ???????????? 配置 seatunnel 环境变量
        SEATUNNEL_HOME: /opt/apache-seatunnel/
      ports:
        - 5081:5081
      networks:
        - seatunnel
      volumes:
      	## ???????????? 挂载 seatunnel 目录
        - /root/apache-seatunnel-2.3.3/:/opt/seatunnel/
    seatunnel-web:
      image: seatunnel-web:1.0.1
      container_name: seatunnel-web
      environment:
      	## ???????????? 需要配置 seatunnel 环境变量
        SEATUNNEL_HOME: /opt/seatunnel
      ports:
        - 8801:8801
      networks:
        - seatunnel
      volumes:
      	## ???????????? 需要同时挂载 seatunnel 和 web 目录
        - /root/apache-seatunnel-2.3.3/:/opt/seatunnel/
        - /root/apache-seatunnel-web-1.0.1-bin/:/opt/seatunnel-web/
          #command: ls -la /opt/seatunnel-web/

networks:
    seatunnel:

docker-compose up -d

上一篇:最新全流程GPT+Python近红外光谱数据分析


下一篇:【无标题】