Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于seata-server的docker镜像 #7014

Closed
wxrqforever opened this issue Nov 19, 2024 · 8 comments
Closed

关于seata-server的docker镜像 #7014

wxrqforever opened this issue Nov 19, 2024 · 8 comments

Comments

@wxrqforever
Copy link
Contributor

Hi 关于seata的版本问题有两个疑问想请教一下
1.想请教一下客户端sdk的版本适合seata-server的版本想对应的吗?
比如我使用的是seata-spring-boot-starter:2.1.0是否配套的server是需要选择2.1.0版本对吗?
2.关于seata-server docker镜像
在docker仓库目前看到的镜像源似乎有两个seataio/seata-server以及apache/seata-server,请问是以apache/seata-server为准是吗?
seataio/seata-server这个我看最新更新的镜像反而是1.8.0.1版本,2.0.0的反而一年前就更新了。

@wxrqforever
Copy link
Contributor Author

这里我的server镜像从seataio/seata-server:1.8.0.1升级到apache/seata-server:2.2.0,有如下报错:

apm-skywalking not enabled
JMX disabled
Affected JVM parameters: -Dlog.home=/root/logs/seata -server -Dloader.path=/lib -Xmx2048m -Xms2048m -Xss640k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/root/logs/seata/java_heapdump.hprof -XX:+DisableExplicitGC -Xloggc:/root/logs/seata/seata_gc.log -verbose:gc -XX:+PrintGCDetails  -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -Dio.netty.leakDetectionLevel=advanced -Dapp.name=seata-server -Dapp.pid=1 -Dapp.home=/ -Dbasedir=/ 
███████╗███████╗ █████╗ ████████╗ █████╗
██╔════╝██╔════╝██╔══██╗╚══██╔══╝██╔══██╗
███████╗█████╗  ███████║   ██║   ███████║
╚════██║██╔══╝  ██╔══██║   ██║   ██╔══██║
███████║███████╗██║  ██║   ██║   ██║  ██║
╚══════╝╚══════╝╚═╝  ╚═╝   ╚═╝   ╚═╝  ╚═╝


15:57:24.209  INFO --- [                     main] [der$InnerEnhancedServiceLoader] [lExtensionDefinition]  [] : Ignore load compatible class io.seata.config.ExtConfigurationProvider, because is not assignable from origin type org.apache.seata.config.ExtConfigurationProvider
15:57:24.310  INFO --- [                     main] [ta.config.ConfigurationFactory] [                load]  [] : load Configuration from :Spring Configuration
15:57:24.319  INFO --- [                     main] [der$InnerEnhancedServiceLoader] [lExtensionDefinition]  [] : Load compatible class io.seata.config.ConfigurationProvider
15:57:24.342  INFO --- [                     main] [onfig.nacos.NacosConfiguration] [ getConfigProperties]  [] : Nacos config auth properties empty.
15:57:24.492  INFO --- [                     main] [seata.server.ServerApplication] [         logStarting]  [] : Starting ServerApplication using Java 1.8.0_342 on b53e2a962dae with PID 1 (/seata-server/classes started by root in /seata-server)
15:57:24.493  INFO --- [                     main] [seata.server.ServerApplication] [ogStartupProfileInfo]  [] : No active profile set, falling back to 1 default profile: "default"
15:57:25.687  INFO --- [                     main] [mbedded.tomcat.TomcatWebServer] [          initialize]  [] : Tomcat initialized with port(s): 7091 (http)
15:57:25.696  INFO --- [                     main] [oyote.http11.Http11NioProtocol] [                 log]  [] : Initializing ProtocolHandler ["http-nio-7091"]
15:57:25.698  INFO --- [                     main] [.catalina.core.StandardService] [                 log]  [] : Starting service [Tomcat]
15:57:25.698  INFO --- [                     main] [e.catalina.core.StandardEngine] [                 log]  [] : Starting Servlet engine: [Apache Tomcat/9.0.90]
15:57:25.777  INFO --- [                     main] [rBase.[Tomcat].[localhost].[/]] [                 log]  [] : Initializing Spring embedded WebApplicationContext
15:57:25.777  INFO --- [                     main] [letWebServerApplicationContext] [ebApplicationContext]  [] : Root WebApplicationContext: initialization completed in 1231 ms
15:57:25.907  WARN --- [                     main] [letWebServerApplicationContext] [             refresh]  [] : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'branchSessionController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'branchSessionDBServiceImpl' defined in file [/seata-server/classes/org/apache/seata/server/console/impl/db/BranchSessionDBServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.seata.server.console.impl.db.BranchSessionDBServiceImpl$$EnhancerBySpringCGLIB$$a3a0446]: Constructor threw exception; nested exception is org.apache.seata.common.loader.EnhancedServiceNotFoundException: not found service provider for : org.apache.seata.core.store.db.DataSourceProvider caused by java.lang.IllegalStateException: Extension instance(definition: org.apache.seata.common.loader.ExtensionDefinition@77f33293, class: interface org.apache.seata.core.store.db.DataSourceProvider)  could not be instantiated: The driver {com.mysql.jdbc.Driver} cannot be found in the path /lib/jdbc/. Please ensure that the appropriate database driver dependencies are included in the classpath.
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.createNewExtension(EnhancedServiceLoader.java:495)
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.getExtensionInstance(EnhancedServiceLoader.java:478)
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.loadExtension(EnhancedServiceLoader.java:453)
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.load(EnhancedServiceLoader.java:347)
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.access$200(EnhancedServiceLoader.java:278)
        at org.apache.seata.common.loader.EnhancedServiceLoader.load(EnhancedServiceLoader.java:116)
        at org.apache.seata.common.loader.EnhancedServiceLoader.load(EnhancedServiceLoader.java:101)
        at org.apache.seata.server.console.impl.db.BranchSessionDBServiceImpl.<init>(BranchSessionDBServiceImpl.java:71)
        at org.apache.seata.server.console.impl.db.BranchSessionDBServiceImpl$$EnhancerBySpringCGLIB$$a3a0446.<init>(<generated>)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:213)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1326)
        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:336)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
        at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:548)
        at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:524)
        at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:677)
        at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:228)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
        at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:329)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:336)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:334)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:591)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1289)
        at org.apache.seata.server.ServerApplication.main(ServerApplication.java:30)
Caused by: org.apache.seata.common.exception.StoreException: The driver {com.mysql.jdbc.Driver} cannot be found in the path /lib/jdbc/. Please ensure that the appropriate database driver dependencies are included in the classpath.
        at org.apache.seata.core.store.db.AbstractDataSourceProvider.validate(AbstractDataSourceProvider.java:82)
        at org.apache.seata.core.store.db.AbstractDataSourceProvider.generate(AbstractDataSourceProvider.java:63)
        at org.apache.seata.core.store.db.AbstractDataSourceProvider.init(AbstractDataSourceProvider.java:54)
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.initInstance(EnhancedServiceLoader.java:707)
        at org.apache.seata.common.loader.EnhancedServiceLoader$InnerEnhancedServiceLoader.createNewExtension(EnhancedServiceLoader.java:492)
        ... 48 more

15:57:25.911  INFO --- [                     main] [.catalina.core.StandardService] [                 log]  [] : Stopping service [Tomcat]
15:57:25.987  INFO --- [                     main] [valuationReportLoggingListener] [          logMessage]  [] : 

这是我的启动配置:
sudo docker run --name seata-server -p 8091:8091 -p 7091:7091 -e SEATA_IP=9.135.91.222 -v $directory/seata-home-config/resources:/seata-server/resources apache/seata-server:2.2.0

我看到了类似的issuce:https://github.com/apache/incubator-seata/issues/6760,看起来这个问题已经修复,我是需要做哪些更新动作吗?

@EdaZhang
Copy link

新的镜像里面没有内置 mysql 驱动了,需要自己打进去或者挂载进去,这是我用的一个 dockerfile

FROM apache/seata-server:2.2.0

# 复制本地的 MySQL 驱动
COPY mysql-connector-java-8.0.26.jar  /seata-server/libs

WORKDIR /seata

@wxrqforever
Copy link
Contributor Author

新的镜像里面没有内置 mysql 驱动了,需要自己打进去或者挂载进去,这是我用的一个 dockerfile

FROM apache/seata-server:2.2.0

# 复制本地的 MySQL 驱动
COPY mysql-connector-java-8.0.26.jar  /seata-server/libs

WORKDIR /seata

我需要在云上部署,不支持简单的映射挂载,没法上传比较大的文件,最好还是看看官方能不能直接解决这个问题吧。

@funky-eyes
Copy link
Contributor

Due to license issues, the seata-server cannot include the MySQL driver.

@EdaZhang
Copy link

@wxrqforever

因为 MySQL 的 license 问题,估计以后的版本都不会内置了。
可以用我上面给的 dcokerfile 本地打一个新的镜像,推到公司的镜像私库,云厂商一般都提供私库服务。或者直接把镜像推到dockerhub,云厂商也能拉到。

@wxrqforever
Copy link
Contributor Author

@wxrqforever

因为 MySQL 的 license 问题,估计以后的版本都不会内置了。 可以用我上面给的 dcokerfile 本地打一个新的镜像,推到公司的镜像私库,云厂商一般都提供私库服务。或者直接把镜像推到dockerhub,云厂商也能拉到。

明白了多谢

@wxrqforever
Copy link
Contributor Author

Due to license issues, the seata-server cannot include the MySQL driver.

好的多谢

@wjtien
Copy link

wjtien commented Dec 24, 2024

即使是在2.3版本, 放在/lib/jdbc/、/seata-server/libs/jdbc/ 也是没用的,必需放在/seata-server/libs/下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants