apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
28.95k stars 10.19k forks source link

docker启动失败 #5005

Closed JohnngSong closed 8 months ago

JohnngSong commented 8 months ago

使用官方给的docker配置启动apolloconfig/apollo-configservice失败,提示Error: Unable to access jarfile apollo-configservice.jar

docker run -p 8080:8080 \ -e SPRING_DATASOURCE_URL="jdbc:mysql://fill-in-the-correct-server:3306/ApolloConfigDB?characterEncoding=utf8" \ -e SPRING_DATASOURCE_USERNAME=FillInCorrectUser -e SPRING_DATASOURCE_PASSWORD=FillInCorrectPassword \ -d -v /tmp/logs:/opt/logs --name apollo-configservice apolloconfig/apollo-configservice:${version}

dosubot[bot] commented 8 months ago

🤖

您好 @JohnngSong,

我是一个可以帮助您解决问题、回答问题并成为贡献者的机器人。在等待人类维护者的同时,我在这里为您提供帮助。

关于您的问题,"无法访问jarfile apollo-configservice.jar"的错误通常发生在系统无法在预期的位置找到指定的.jar文件时。在您分享的上下文中,startup.sh脚本在当前目录或者如果存在的话,在名为"current"的目录中寻找名为服务名(在这种情况下,为"apollo-configservice.jar")的.jar文件。

脚本首先检查当前目录中是否有以服务名开头并且不以"-sources.jar"结尾的.jar文件。如果找到了,它将设置为.jar文件的路径。如果没有找到并且存在名为"current"的目录,它将切换到那个目录并重复该过程。

如果脚本仍然找不到.jar文件,并且环境变量APOLLO_RUN_MODE设置为"Docker",它将尝试直接在当前目录中执行.jar文件,如果.jar文件不存在,这将失败。

因此,您应确保apollo-configservice.jar文件存在于startup.sh脚本的同一目录或该目录中名为"current"的目录中。如果.jar文件不在这两个位置中的任何一个,您将需要修改您的Dockerfile或您的构建过程,以确保它被复制到正确的位置。

此外,我还找到了一个类似的已解决问题,建议检查是否有另一个服务器在8080端口上运行,使用命令curl http://localhost:8080。如果有,您可能需要停止该服务器或更改Apollo使用的端口。

希望这些信息对您有所帮助。如果您有任何其他问题或需要进一步的澄清,请随时告诉我。

参考资料:

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

JohnngSong commented 8 months ago

哎,latest版本是真的坑,没有jar包

nobodyiam commented 8 months ago

可以参考下 #4848

JohnngSong commented 8 months ago

@nobodyiam 可以了,不过有个新的问题,portal 的docker启动后8070口无法访问,没看到错误,请看完整日志: OpenJDK 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release. OpenJDK 64-Bit Server VM warning: CMSFullGCsBeforeCompaction is deprecated and will likely be removed in a future release.


/ \   _ __   ___ | | | ___

/ \ | ' \ / | | |/ \ / | |) | () | | | () | // \\ ./ _/|||_/ |_|

:: Spring Boot :: (v2.6.8)

2023-11-03 14:11:32.810 INFO 1 --- [ main] c.c.f.apollo.portal.PortalApplication : Starting PortalApplication v2.1.0 using Java 1.8.0_342 on 9f6ebbdff348 with PID 1 (/apollo-portal/apollo-portal-2.1.0.jar started by root in /apollo-portal) 2023-11-03 14:11:32.816 INFO 1 --- [ main] c.c.f.apollo.portal.PortalApplication : The following 2 profiles are active: "github", "auth" 2023-11-03 14:11:34.883 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2023-11-03 14:11:34.885 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2023-11-03 14:11:35.072 INFO 1 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 175 ms. Found 14 JPA repository interfaces. 2023-11-03 14:11:36.332 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8070 (http) 2023-11-03 14:11:36.357 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2023-11-03 14:11:36.358 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.63] 2023-11-03 14:11:36.476 INFO 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2023-11-03 14:11:36.477 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3595 ms 2023-11-03 14:11:36.654 INFO 1 --- [ main] o.s.s.p.JdbcUserDetailsManager : No authentication manager set. Reauthentication of users when changing passwords will not be performed. 2023-11-03 14:11:36.788 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2023-11-03 14:11:37.099 INFO 1 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2023-11-03 14:11:37.175 INFO 1 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2023-11-03 14:11:37.304 INFO 1 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.9.Final 2023-11-03 14:11:37.605 INFO 1 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} 2023-11-03 14:11:37.837 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect 2023-11-03 14:11:37.959 WARN 1 --- [ main] org.hibernate.cfg.AnnotationBinder : HHH000503: A class should not be annotated with both @Inheritance and @MappedSuperclass. @Inheritance will be ignored for: com.ctrip.framework.apollo.common.entity.BaseEntity. 2023-11-03 14:11:39.102 INFO 1 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2023-11-03 14:11:39.116 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2023-11-03 14:11:40.371 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : apollo.portal.envs = dev,prod 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : organizations = [{"orgId":"Java","orgName":"Java"},{"orgId":"TEST2","orgName":"样例部门2"}]. Old value = null 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : superAdmin = apollo. Old value = null 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : api.readTimeout = 10000. Old value = null 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : consumer.token.salt = someSalt. Old value = null 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : admin.createPrivateNamespace.switch = true. Old value = null 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : configView.memberOnly.envs = pro. Old value = null 2023-11-03 14:11:40.372 INFO 1 --- [ main] c.c.f.a.p.s.PortalDBPropertySource : Load config from DB : apollo.portal.meta.servers = {"dev":"http://configservice-dev-ha:8080","prod":"http://configservice-prod-ha:8080"}. Old value = null 2023-11-03 14:11:40.984 INFO 1 --- [ main] f.a.p.e.DatabasePortalMetaServerProvider : Loaded meta server addresses from portal config: {PROD=http://configservice-prod-ha:8080, DEV=http://configservice-dev-ha:8080} 2023-11-03 14:11:40.987 INFO 1 --- [ main] .f.a.p.e.DefaultPortalMetaServerProvider : Loaded meta server addresses from system property, os environment and properties file: {UAT=http://fill-in-uat-meta-server:8080, PRO=http://fill-in-pro-meta-server:8080, LPT=${lpt_meta}, DEV=http://fill-in-dev-meta-server:8080, FAT=http://fill-in-fat-meta-server:8080, LOCAL=http://localhost:8080} 2023-11-03 14:11:41.930 WARN 1 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning

2023-11-03 14:11:41.974 INFO 1 --- [erviceLocator-1] c.c.f.a.p.e.PortalMetaDomainService : Located meta server address [http://configservice-dev-ha:8080] for env [DEV]

2023-11-03 14:11:42.281 INFO 1 --- [erviceLocator-1] c.c.f.a.p.e.PortalMetaDomainService : Located meta server address [http://configservice-prod-ha:8080] for env [PROD] 2023-11-03 14:11:42.369 INFO 1 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@542ff147, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@2d801d8, org.springframework.security.web.context.SecurityContextPersistenceFilter@5a51336a, org.springframework.security.web.header.HeaderWriterFilter@52433946, org.springframework.security.web.authentication.logout.LogoutFilter@59127611, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@2299d903, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@632d4cf2, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@59a94d0f, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@2b1a901d, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@b9b97ad, org.springframework.security.web.session.SessionManagementFilter@48e74764, org.springframework.security.web.access.ExceptionTranslationFilter@166e5a6d, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@66b6873f] 2023-11-03 14:11:42.671 INFO 1 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] 2023-11-03 14:11:43.095 INFO 1 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s) beneath base path '' 2023-11-03 14:11:43.170 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8070 (http) with context path '' 2023-11-03 14:11:43.193 INFO 1 --- [ main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing 2023-11-03 14:11:43.204 INFO 1 --- [ main] c.c.f.apollo.portal.PortalApplication : Started PortalApplication in 11.047 seconds (JVM running for 12.28)