Seatunnel-2.3.3 自打包 docker部署(含web)
创始人
2025-01-15 07:33:39
0

前言

此篇重点是,自己将源码编译后,将打包文件部署在docker里(也可以直接用官网的)

如果也有人是希望,将自己打包的源码部署了,可以参考可乐的这篇文章,这篇文章详细介绍了2.3.3的serve和web的源码启动流程

Apache Seatunnel本地源码构建编译运行调试

前期准备

  1. docker环境
  2. seatunnel-2.3.3  二进制执行文件(apache-seatunnel-2.3.4-bin.tar.gz解压后的文件)
  3. seatunnel-web-1.0.0 二进制可执行文件
  4. cp /opt/seatunnel/apache-seatunnel-2.3.3/config/hazelcast-client.yaml /opt/seatunnel/apache-seatunnel-web-1.0.0-bin/conf/

4的命令不用执行,只要是给大家一个参考,记得吧hazelcast-client.yaml文件覆盖到二进制里面去,同时hazelcast-client.yaml的内容改一下,主要把127或者localhost改为本机宿主机ip

提示:  这里我就默认大家,已经解决了所有,可乐文章里的疑难杂症,也就是说,

源码是可以添加数据源,可以添加任务执行单表操作的。

如果!!! 不能保障!!!请先看可乐文章后,再阅读本篇,不然的话,真的会很痛苦,要不断编译,不断部署!!!

文件目录介绍

--docer-compose.yml

--seatunnel

        --Dockerfile

        --Dockerfile_web

        --apache-seatunnel-2.3.3

        --apache-seatunnel-web-1.0.0

文件内容

docker-compose.yml

version: '3' services:   seatunnel-serve:     build:         context: ./seatunnel/         dockerfile: Dockerfile     container_name: seatunnel_serve     ports:       - 5801:5801     command: nohup sh bin/seatunnel-cluster.sh 2>&1 &     volumes:       - ./seatunnel/apache-seatunnel-2.3.3/:/opt/seatunnel/     restart: always     networks:       - app   seatunnel-web:     build:         context: ./seatunnel/         dockerfile: Dockerfile_web     volumes:       - ./seatunnel/apache-seatunnel-web-1.0.0/:/opt/seatunnel_web/     container_name: seatunnel_web     entrypoint: /opt/seatunnel_web/bin/chmod-daemon.sh     ports:       - 8801:8801     restart: always     networks:       - app volumes:   data: networks:   app:     external: true  

Dockerfile

这个其实也可以不用,但是有个小瑕疵没解决,先预留

# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements.  See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License.  You may obtain a copy of the License at # #    http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #  FROM openjdk:8 ENV SEATUNNEL_HOME="/opt/seatunnel" RUN  mkdir -p SEATUNNEL_HOME/logs WORKDIR /opt/seatunnel    

Dockerfile_web

# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements.  See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License.  You may obtain a copy of the License at # #    http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #  FROM openjdk:8 user root ENV SEATUNNEL_HOME="/opt/seatunnel_web" COPY ./apache-seatunnel-web-1.0.0/ ${SEATUNNEL_HOME}/ RUN  mkdir -p SEATUNNEL_HOME/logs RUN chmod +x /opt/seatunnel_web/bin/seatunnel-backend-daemon.sh RUN chmod +x /opt/seatunnel_web/bin/chmod-daemon.sh WORKDIR /opt/seatunnel_web #CMD ["chmod"," +x", "bin/seatunnel-backend-daemon.sh"] #CMD ["sh", "/opt/seatunnel_web/bin/seatunnel-backend-daemon.sh", "start"]  CMD ["tail"," -f", "nohup.out"]     

chmod-daemon.sh

这里有个小瑕疵

 sh /opt/seatunnel_web/bin/seatunnel-backend-daemon.sh start权限问题一直没有解决

所以我在seatunnel-backend-daemon.sh打了echo,把参数都打印出来了,打印出来后直接贴到了这里,这个后期我解决了,我会上报解决方案

注意!!!chmod-daemon.sh会存在sh文件格式的问题

映射进去的时候可能是CRLF的格式,linux识别不来,所以在docker-compose里的entrypoint查找文件的时候,会报no such file or directory

注意文件格式是LF还是CRLF

LF   linux

CRLF  window

#!/bin/sh  # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements.  See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License.  You may obtain a copy of the License at # #    http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # #echo test111111111 chmod 777 /opt/seatunnel_web/bin/seatunnel-backend-daemon.sh echo 111111111111111111111111123  /usr/local/openjdk-8/bin/java -server -Xms1g -Xmx1g -Xmn512m -XX:+PrintGCDetails -Xloggc:gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -Dseatunnel-web.logs.path=/opt/seatunnel_web/bin/../logs -cp /opt/seatunnel_web/bin/../conf:/opt/seatunnel_web/bin/../libs/*:/opt/seatunnel_web/bin/../datasource/* -Dspring.config.name=application.yml -Dspring.config.location=classpath:application.yml org.apache.seatunnel.app.SeatunnelApplication # sh /opt/seatunnel_web/bin/seatunnel-backend-daemon.sh start

还有一种解决方案(这是可乐提供的解决方案,不过没有测试,先贴在这里)

sh 如果是在windows下直接打开复制过去的,会有让shell文件的格式有问题,镜像运行的时候报初始化脚本\r问题,所以需要在wsl进入centOs子系统中执行如下: sed -i ‘s/\r$//’ filename 将xxxx.sh格式转为linux下的格式

相关内容

热门资讯

黑科技免费(wopoker有没... 黑科技免费(wopoker有没有外挂)外挂透明挂辅助器(透视)竟然是真的有挂(有挂分享)-哔哩哔哩w...
黑科技安装(WePoKe)we... 黑科技安装(WePoKe)wepoke打伙牌(ai代打)本来真的是有挂(2026已更新)(哔哩哔哩)...
重大来袭!德扑人工智能(透视)... 重大来袭!德扑人工智能(透视)详细教程(2023已更新)(哔哩哔哩);人气非常高,ai更新快且高清可...
黑科技计算(WePoKe)we... 黑科技计算(WePoKe)wepoke有插件吗(透明黑科技)果然是真的有挂(2025已更新)(哔哩哔...
黑科技ai代打(德州ai辅助神... 黑科技ai代打(德州ai辅助神器软件怎么使用)外挂透明挂辅助黑科技(透视)其实是真的有挂(有挂教学)...
记者揭秘!!红龙扑克辅助器下载... 记者揭秘!!红龙扑克辅助器下载地址(辅助挂)透牌教程(2026已更新)(哔哩哔哩)1、任何德州ai辅...
黑科技安装(WePoKe)We... 黑科技安装(WePoKe)Wepoke透明挂(透明黑科技)果然真的是有挂(2024已更新)(哔哩哔哩...
黑科技ai(wpk微扑克智能辅... 黑科技ai(wpk微扑克智能辅助)外挂透明挂辅助工具(透视)切实真的是有挂(有挂详情)-哔哩哔哩1、...
三分钟了解!aapoker这个... 三分钟了解!aapoker这个软件靠谱吗(软件透明挂)wpk教程(2020已更新)(哔哩哔哩);一、...
黑科技总结(wepoke ai... 黑科技总结(wepoke ai)外挂透明挂辅助神器(透视)一直存在有挂(有挂方式)-哔哩哔哩1、we...