第一步:下载
SeaTunnel2.3.1源码
下载地址:https://seatunnel.apache.org/download
Idea中的目录结构
第二部:通过源码编译 Apache SeaTunnel
通过maven进行代码编译
编译命令
mvn clean package -pl seatunnel-dist -am -Dmaven.test.skip=true
复制
编译单个模块命令
mvn clean package -pl seatunnel-examples/seatunnel-engine-examples -am -Dmaven.test.skip=true -T 1C
复制
第三步:运行
编译完通过SeaTunnelEngineExample类来运行
public class SeaTunnelEngineExample {
public static void main(String[] args)
throws FileNotFoundException, URISyntaxException, CommandException {
String configurePath = args.length > 0 ? args[0] : "/examples/fake_to_console.conf";
String configFile = getTestConfigFile(configurePath);
ClientCommandArgs clientCommandArgs = new ClientCommandArgs();
clientCommandArgs.setConfigFile(configFile);
clientCommandArgs.setCheckConfig(false);
clientCommandArgs.setJobName(Paths.get(configFile).getFileName().toString());
Change Execution Mode to CLUSTER to use client mode, before do this, you should start
SeaTunnelEngineServerExample
clientCommandArgs.setMasterType(MasterType.LOCAL);
SeaTunnel.run(clientCommandArgs.buildCommand());
}
复制
这样就运行成功啦!
附上配置文件样例
env {
execution.parallelism = 2
job.mode = "BATCH"
}
source {
Jdbc {
url = "jdbc:mysql://xxxxxx:3306/xxxxx"
driver = "com.mysql.cj.jdbc.Driver"
connection_check_timeout_sec = 100
user = "root"
password = "xxxxx"
query = "select * from test"
#partition_column = "id"
#partition_num = 10
}
}
sink {
Redis {
host = xxxxxx
port = 6379
key = "seatunnel_jdbc"
data_type = list
auth = "xxxxxx"
}
}
复制
运行结果
常见问题
java.lang.RuntimeException: Plugin PluginIdentifier{engineType='seatunnel', pluginType='source', pluginName='XXXX'} not found.
复制
这种报错是seatunnel-engine-examples模块缺少引用,在pom中引用下对应插件重新编译即可
<dependency>
<groupId>org.apache.seatunnel</groupId>
<artifactId>connector-rabbitmq</artifactId>
<version>${project.version}</version>
</dependency>
复制
mvn clean package -pl seatunnel-dist -am -Dmaven.test.skip=true
复制
如果maven提示下载listenablefuture失败,可以通过链接
(https://download.csdn.net/download/u010479989/87965702)下载
版权声明:本文为CSDN博主「小灰灰__」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u010479989/article/details/130868244
Apache SeaTunnel
精彩推荐
点击在看点赞转发⭐️!

文章转载自SeaTunnel,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
千万级数据秒级响应!碧桂园基于 EMR Serverless StarRocks 升级存算分离架构实践
阿里云大数据AI技术
239次阅读
2025-04-27 15:28:51
周边生态|PGRX for Cloudberry 开源,pgvector for Cloudberry 升级到 0.8.0
HashData
235次阅读
2025-04-11 15:35:07
国产非关系型数据库 Eloqkv 初体验
JiekeXu
139次阅读
2025-04-10 23:51:35
融合Redis缓存的PostgreSQL高可用架构
梧桐
93次阅读
2025-04-08 06:35:40
内核探究|Apache Cloudberry™ PAX 行列混存方案技术解析
HashData
83次阅读
2025-04-16 10:33:54
内核探究|Apache Cloudberry 并行查询技术解析
HashData
77次阅读
2025-03-31 10:00:24
APEX中文社区2025北京站活动成功举办
甲骨文云技术
62次阅读
2025-04-29 10:35:47
Oracle云大翻车:传6百万用户认证数据泄漏
非法加冯
52次阅读
2025-03-31 10:00:54
演讲切片 | GreptimeDB MCP 如何让大模型驾驭实时数据?
GreptimeDB
49次阅读
2025-03-31 10:03:03
纯干货 | Dolphinscheduler Master模块源码剖析
海豚调度
44次阅读
2025-04-01 18:30:33