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下的格式

相关内容

热门资讯

正版辅助器技巧!智星菠萝德州多... 正版辅助器技巧!智星菠萝德州多功能有开挂-其实有挂秘籍1、智星菠萝德州透视辅助软件激活码多个强度级别...
正版作弊器插件!AAPoKer... 正版作弊器插件!AAPoKer多功能有开挂-好像有挂秘诀1、点击下载安装,AAPoKer脚本分类一目...
正版作弊器脚本!AAPoKer... 正版作弊器脚本!AAPoKer多功能存在有开挂-果然有挂方式1、完成AAPoKer辅助器v3.3的残...
正版透视挂app!wpk多功能... 正版透视挂app!wpk多功能有开挂-其实有挂助手1、wpk免费脚本咨询教程、wpk免费脚本弱密码等...
正版作弊器工具!wpk多功能有... 正版作弊器工具!wpk多功能有开挂-总是有人有挂1)wpk免费钻石:进一步探索wpk免费脚本大陆,与...
正版作弊器app!aapoke... 正版作弊器app!aapoker多功能真的是有开挂-真是有挂分享aapoker辅助器是一种具有地方特...
正版透视挂方法!aapoker... 正版透视挂方法!aapoker多功能有开挂-本来有挂细节1、下载好aapoker脚本下载之后点击打开...
正版外挂技巧!WePoKer多... 正版外挂技巧!WePoKer多功能真的是有开挂-其实有挂神器1、游戏颠覆性的策略玩法,独创攻略技巧玩...
正版辅助方法!wpk多功能存在... 正版辅助方法!wpk多功能存在有开挂-竟然有挂秘笈wpk透视方法中分为三种模型:wpk靠谱、wpk辅...
正版辅助器器!智星德州扑克多功... 正版辅助器器!智星德州扑克多功能有开挂-一贯有挂方式1)智星德州扑克免费钻石:进一步探索智星德州扑克...