暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

手把手教你掌握SeaTunnel k8s运行Zeta引擎本地模式的技巧

SeaTunnel 2024-04-23
555

点击蓝字

关注我们

转载自小虾米0.0
导读:SeaTunnel提供了一种运行Zeta引擎(local-mode模式)的方法,可以让Kubernetes在本地运行Zeta引擎,实现更高效的应用程序部署和管理。在本文中,我们将探索SeaTunnel k8s运行zeta引擎(local-mode模式)的更多信息,了解如何更好地利用Zeta引擎的优势。

运行

1. 将SeaTunnel上传至服务器上。
我之前已经解压并执行过install-plugin.sh,这里为了方便,我直接用的执行过install-plugin.sh脚本之后的seatunnel做演示。
执行过install-plugin后的lib目录包含如下

tar -zxvf apache-seatunnel-2.3.3-bin.tar.gz
sh apache-seatunnel-2.3.3/bin/install-plugin.sh
tar -czvf apache-seatunnel-2.3.3-bin.tar.gz apache-seatunnel-2.3.3

2. 构建SeaTunnel镜像。
在安装seatunnel的同级文件夹下创建Dockerfile。配置如下,可自行选择版本
FROM openjdk:8

ENV SEATUNNEL_VERSION="2.3.3"
COPY apache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz opt/apache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz
WORKDIR opt
RUN tar -xzvf apache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz
RUN mv apache-seatunnel-${SEATUNNEL_VERSION} seatunnel
RUN rm -f opt/apache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz
WORKDIR opt/seatunnel

执行命令
docker build -t seatunnel:2.3.3 -f Dockerfile.

  1. 查看镜像
docker images

如下所示镜像

  1. 将镜像load进k8s,这里用的minikube做演示
minikube image load seatunnel:2.3.3


minikube image ls

查看镜像

  1. 创建seatunnel.streaming.conf
    如下所示
env {
execution.parallelism = 1
job.mode = "STREAMING"
checkpoint.interval = 2000
}

source {
FakeSource {
result_table_name = "fake"
row.num = 160000
schema = {
fields {
name = "string"
age = "int"
}
}
}
}

transform {

}

sink {
Console {}
}

  1. 创建configmap
kubectl create cm seatunnel-config \
--from-file=seatunnel.streaming.conf=seatunnel.streaming.conf
1
2
8.创建seatunnel.yaml如下示例

apiVersion: v1
kind: Pod
metadata:
name: seatunneltest
spec:
containers:
- name: seatunnel
image: seatunnel:2.3.3
command: ["/bin/sh","-c","/opt/seatunnel/bin/seatunnel.sh --config data/seatunnel.streaming.conf -e local"]
volumeMounts:
- name: seatunnel-config
mountPath: data/seatunnel.streaming.conf
subPath: seatunnel.streaming.conf
volumes:
- name: seatunnel-config
configMap:
name: seatunnel-config
items:
- key: seatunnel.streaming.conf
path: seatunnel.streaming.conf
~

执行
kubectl apply -f seatunnel.yaml

查看pod结果如下

原文链接:https://blog.csdn.net/weixin_41854429/article/details/132619265

Attention!


📣📣Apache SeaTunnel 社区 6月Meetup招募讲师进行中!欢迎来SeaTunnel社区组织的线上或线下活动分享你的经验,获得精美礼品和讲师证书!


🔮🔮速戳链接或扫码报名:http://whaleops.mikecrm.com/nnueRr0




Apache SeaTunnel





Apache SeaTunnel 是一个分布式、高性能、易扩展、用于海量数据(离线&实时)同步和转化的数据集成平台

仓库地址: 
https://github.com/apache/seatunnel

网址:
https://seatunnel.apache.org/

Apache SeaTunnel 下载地址:
https://seatunnel.apache.org/download
 
衷心欢迎更多人加入!

我们相信,在「Community Over Code」(社区大于代码)、「Open and Cooperation」(开放协作)、「Meritocracy」(精英管理)、以及「多样性与共识决策」等 The Apache Way 的指引下,我们将迎来更加多元化和包容的社区生态,共建开源精神带来的技术进步!


我们诚邀各位有志于让本土开源立足全球的伙伴加入 SeaTunnel 贡献者大家庭,一起共建开源!

提交问题和建议:
https://github.com/apache/seatunnel/issues

贡献代码:
https://github.com/apache/seatunnel/pulls

订阅社区开发邮件列表 : 
dev-subscribe@seatunnel.apache.org

开发邮件列表:
dev@seatunnel.apache.org

加入 Slack:
https://join.slack.com/t/apacheseatunnel/shared_invite/zt-1kcxzyrxz-lKcF3BAyzHEmpcc4OSaCjQ

关注 Twitter: 
https://twitter.com/ASFSeaTunnel

精彩推荐




Apache SeaTunnel Connector 使用文档和使用案例有奖征稿来了!一起玩开源




融入大数据技术革新的洪流!2024 SeaTunnel Meetup 讲师招募开启




Apache SeaTunnel 入选 2024 开源数据工程生态系统全景图!



点击阅读原文了解更多⭐️!

文章转载自SeaTunnel,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论