注:安装SeaTunnel Web1.0.1没区别,步骤全部都一样。
安装的SeaTunnel为2.3.7版本,以下安装基于SeaTunnel已经安装好的场景,SeaTunnel master节点和SeaTunnel web应用在同一台机器上,SeaTunnel为一个master节点一个worker节点。
SeaTunnel路径为:/data/seatunnel/seatunnel-2.3.7
SeaTunnel Web路径为:/data/seatunnel/seatunnel-web-1.0.0
一、下载包
Apache SeaTunnel
上传到服务器上并解压
-- 路径:/data/seatunnel/apache-seatunnel-web-1.0.0-bin.tar.gz
tar -zxvf apache-seatunnel-web-1.0.0-bin.tar.gz-- 修改名字
mv apache-seatunnel-web-1.0.0-bin seatunnel-web-1.0.0
二、配置数据库
1、创建seatunnel-web所需表
数据库和seatunnel-web应用没在同一台机器上
mysql上执行sql脚本,sql脚本路径为:/data/seatunnel/seatunnel-web-1.0.0/script/seatunnel_server_mysql.sql
2、配置数据库连接
vim /data/seatunnel/seatunnel-web-1.0.0/conf/application.yml
三、配置所需seatunnel配置
1、将/seatunnel/config/hazelcast-client.yaml复制到seatunnel web目录下
cp /data/seatunnel/seatunnel-2.3.7/config/hazelcast-client.yaml /data/seatunnel/seatunnel-web-1.0.0/conf
修改 hazelcast-client.network.cluster-members配置
2、配置支持的插件信息
将seatunnel中的plugin-mapping.properties复制到seatunnel web目录下
cp /data/seatunnel/seatunnel-2.3.7/connectors/plugin-mapping.properties /data/seatunnel/seatunnel-web-1.0.0/conf
3、如果是seatunnel web1.0.1增加secretKey,否则报错;修改文件为:/data/seatunnel/seatunnel-web-1.0.1/conf/application.yml
[GlobalExceptionHandler.logError():83] - JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.
io.jsonwebtoken.security.SignatureException: JWT signature does not match locally computed signature. JWT validity cannot be asserted and should not be trusted.at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:383)at io.jsonwebtoken.impl.DefaultJwtParser.parse(DefaultJwtParser.java:513)at io.jsonwebtoken.impl.DefaultJwtParser.parseClaimsJws(DefaultJwtParser.java:573)at org.apache.seatunnel.app.security.JwtUtils.parseToken(JwtUtils.java:71)at org.apache.seatunnel.app.interceptor.AuthenticationInterceptor.preHandle(AuthenticationInterceptor.java:74)at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:148)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1062)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)at javax.servlet.http.HttpServlet.service(HttpServlet.java:497)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)at javax.servlet.http.HttpServlet.service(HttpServlet.java:584)at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)at org.eclipse.jetty.server.Server.handle(Server.java:516)at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)at java.lang.Thread.run(Thread.java:748)
四、上传jar包
1、下载包
按需下载自己需要的包,快捷方式下载jar包可以使用:https://seatunnel.apache.org/assets/files/download_datasource-4b79e6fafe80459590a6a0fc2865e5ac.sh
如果是SeaTunnel Web1.0.0,version=1.0.0,如果是SeaTunnel Web1.0.1,version=1.0.1
包mysql-connector-java-8.0.20.jar需要单独下载,下载地址:https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.20
2、上传jar包
上传到:/data/seatunnel/seatunnel-web-1.0.0/libs路径下
五、启动程序
注意:必须到bin前面一级启动,要不然启动会报错:必须是./bin/seatunnel-backend-daemon.sh start,不能是.seatunnel-backend-daemon.sh start
# 进入/data/seatunnel/seatunnel-web-1.0.0/bin
cd /data/seatunnel/seatunnel-web-1.0.0/bin# 给seatunnel-backend-daemon.sh加执行权限
chmod +x seatunnel-backend-daemon.sh# 启动webui,注意:必须到bin前面一级启动,要不然启动会报错
cd /data/seatunnel/seatunnel-web-1.0.0
./bin/seatunnel-backend-daemon.sh start
启动成功后访问一下地址:http://机器ip:8801/ui/#/login 账号密码都是admin
六、启动后错误信息查看
启动后日志查看:/data/seatunnel/seatunnel-web-1.0.0/logs/seatunnel-web.log
ps:启动报错大概率是上传的jar包有问题,一般是版本冲突或者是缺少包
问题1、NoClassDefFoundError: org/apache/seatunnel/api/sink/SinkCommonOptions
启动报以下错误,解决办法:
seatunnel-api-2.3.3.jar包缺少该类,从https://mvnrepository.com/artifact/org.apache.seatunnel/seatunnel-api/2.3.7 下载jar包(jar包版本跟seatunnel版本匹配,当前安装的seatunnel是2.3.7版本,所以下载的2.3.7版本的包)
2024-10-09 17:03:57.315 seatunnel FE-Follower01 ERROR [main] [SpringApplication.reportFailure():835] - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectorCache' defined in URL [jar:file:/data/seatunnel/seatunnel-web-1.0.0/libs/seatunnel-app-1.0.0.jar!/org/apache/seatunnel/app/bean/connector/ConnectorCache.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.seatunnel.app.bean.connector.ConnectorCache]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/seatunnel/api/sink/SinkCommonOptionsat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1334)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1232)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420)at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317)at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306)at org.apache.seatunnel.app.SeatunnelApplication.main(SeatunnelApplication.java:36)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.seatunnel.app.bean.connector.ConnectorCache]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/seatunnel/api/sink/SinkCommonOptionsat org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:224)at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1326)... 17 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/apache/seatunnel/api/sink/SinkCommonOptionsat org.apache.seatunnel.connectors.seatunnel.console.sink.ConsoleSinkFactory.optionRule(ConsoleSinkFactory.java:56)at org.apache.seatunnel.api.table.factory.FactoryUtil.sinkFullOptionRule(FactoryUtil.java:282)at org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.lambda$getAllPlugin$5(AbstractPluginDiscovery.java:273)at java.lang.Iterable.forEach(Iterable.java:75)
问题2:找不到数据源
寻找原因中……原本安装的seatunnel web1.0.1有下面这个问题,降了一个版本到1.0.0结果发现还是有这个问题。