Seatunnel-2.3.3 自打包 docker部署(含web)

前言

此篇重点是,自己将源码编译后,将打包文件部署在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下的格式

  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
首先,seatunnel2.3.3是一个用于构建和管理虚拟网络的解决方案,可以提供安全的远程访问和通信。以下是安装和部署Seatunnel2.3.3的步骤: 1. 确保您的系统满足要求:Seatunnel2.3.3支持的操作系统和硬件需求。请确保您的系统满足这些要求。 2. 下载Seatunnel2.3.3安装包:您可以从官方网站或其他可靠的来源下载Seatunnel2.3.3的安装包。 3. 解压安装包:将下载的安装包解压到您选择的目录。您可以使用命令行工具或压缩软件来完成这个步骤。 4. 配置Seatunnel2.3.3:打开Seatunnel2.3.3文件夹,找到配置文件。根据您的需求和网络环境,进行必要的配置,例如设置IP地址、端口号等。 5. 启动Seatunnel2.3.3:在命令行中进入Seatunnel2.3.3目录,运行启动命令。这将启动Seatunnel2.3.3并开始监听指定的端口。 6. 测试连接:使用其他设备或计算机,尝试远程连接到Seatunnel2.3.3提供的IP地址和端口。如果连接成功,您应该能够访问和管理虚拟网络。 7. 配置其他功能:根据您的需求,可以配置其他功能,如加密、认证和访问控制。 8. 管理和维护:根据需要进行管理和维护,例如添加、删除或修改虚拟网络的设置。 需要注意的是,这只是Seatunnel2.3.3的基本安装和部署步骤。具体的步骤可能因您的系统和环境而有所不同。在安装和部署过程中,确保详细阅读官方文档,并根据您的要求和需求进行相应的配置和操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值