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

针对Docker版本的apollo-quick-start来集成spring-boot-logger的问题 #21

Open
Jiiiiiin opened this issue Mar 23, 2019 · 4 comments

Comments

@Jiiiiiin
Copy link
Contributor

问题描述:

  • 测试机器本地mac os
  • 先启动Apollo Quick Start Docker部署服务,按照文档所属
  • 接着在portal按照apollo-use-cases/spring-boot-loggerREADME.md创建应用和配置
  • 启动应用,日志如下:
 :: Spring Boot ::        (v2.0.3.RELEASE)

2019-03-23 21:22:17.407  INFO 97534 --- [           main] c.c.f.a.u.c.s.boot.logger.Application    : Starting Application on jiiiiiins-MacBook-Pro.local with PID 97534 (/Users/jiiiiiin/Documents/GitHub/apollo-use-cases/spring-boot-logger/target/classes started by jiiiiiin in /Users/jiiiiiin/Documents/GitHub/apollo-use-cases)
2019-03-23 21:22:17.411  INFO 97534 --- [           main] c.c.f.a.u.c.s.boot.logger.Application    : No active profile set, falling back to default profiles: default
2019-03-23 21:22:17.462  INFO 97534 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1fc32e4f: startup date [Sat Mar 23 21:22:17 CST 2019]; root of context hierarchy
2019-03-23 21:22:17.839  INFO 97534 --- [           main] c.c.f.f.i.p.DefaultApplicationProvider   : App ID is set to spring-boot-logger by app.id property from System Property
2019-03-23 21:22:17.840  INFO 97534 --- [           main] c.c.f.f.i.p.DefaultServerProvider        : Environment is set to null. Because it is not available in either (1) JVM system property 'env', (2) OS env variable 'ENV' nor (3) property 'env' from the properties InputStream.
2019-03-23 21:22:17.991  INFO 97534 --- [           main] c.c.f.a.i.DefaultMetaServerProvider      : Located meta services from apollo.meta configuration: http://localhost:8080!
2019-03-23 21:22:17.994  INFO 97534 --- [           main] c.c.f.apollo.core.MetaDomainConsts       : Located meta server address http://localhost:8080 for env UNKNOWN from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider
2019-03-23 21:22:23.048  WARN 97534 --- [           main] c.c.f.a.i.RemoteConfigRepository         : Load config failed, will retry in 1 SECONDS. appId: spring-boot-logger, cluster: default, namespaces: application
2019-03-23 21:22:29.057  WARN 97534 --- [           main] c.c.f.a.i.AbstractConfigRepository       : Sync config failed, will retry. Repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository, reason: Load Apollo Config failed - appId: spring-boot-logger, cluster: default, namespace: application, url: http://172.18.0.4:8080/configs/spring-boot-logger/default/application?ip=192.168.33.1 [Cause: Could not complete get operation [Cause: Read timed out]]
2019-03-23 21:22:34.070  WARN 97534 --- [           main] c.c.f.a.i.RemoteConfigRepository         : Load config failed, will retry in 1 SECONDS. appId: spring-boot-logger, cluster: default, namespaces: application
2019-03-23 21:22:40.077  WARN 97534 --- [           main] c.c.f.a.i.LocalFileConfigRepository      : Sync config from upstream repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository failed, reason: Load Apollo Config failed - appId: spring-boot-logger, cluster: default, namespace: application, url: http://172.18.0.4:8080/configs/spring-boot-logger/default/application?ip=192.168.33.1 [Cause: Could not complete get operation [Cause: Read timed out]]
2019-03-23 21:22:45.082  WARN 97534 --- [           main] c.c.f.a.i.RemoteConfigRepository         : Load config failed, will retry in 1 SECONDS. appId: spring-boot-logger, cluster: default, namespaces: application
2019-03-23 21:22:51.085  WARN 97534 --- [ngPollService-1] c.c.f.a.i.RemoteConfigLongPollService    : Long polling failed, will retry in 1 seconds. appId: spring-boot-logger, cluster: default, namespaces: application, long polling url: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D, reason: java.io.IOException: Server returned HTTP response code: 503 for URL: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D [Cause: Server returned HTTP response code: 503 for URL: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D [Cause: Server returned HTTP response code: 503 for URL: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D]]
2019-03-23 21:22:51.092  WARN 97534 --- [           main] c.c.f.a.i.LocalFileConfigRepository      : Sync config from upstream repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository failed, reason: Load Apollo Config failed - appId: spring-boot-logger, cluster: default, namespace: application, url: http://172.18.0.4:8080/configs/spring-boot-logger/default/application?ip=192.168.33.1 [Cause: Could not complete get operation [Cause: Read timed out]]
2019-03-23 21:22:51.108  INFO 97534 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-03-23 21:22:51.176  INFO 97534 --- [           main] c.c.f.a.u.c.s.b.l.LoggerConfiguration    : 监听到level变化 debug logging.level.com.ctrip.framework.apollo.use.cases.spring.boot.logger
2019-03-23 21:22:51.177  INFO 97534 --- [           main] c.c.f.a.u.c.s.b.l.LoggerConfiguration    : logging.level.com.ctrip.framework.apollo.use.cases.spring.boot.logger:debug
2019-03-23 21:22:51.183  INFO 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是info级别日志
2019-03-23 21:22:51.183 ERROR 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是error级别日志
2019-03-23 21:22:51.183  WARN 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是warn级别日志
2019-03-23 21:22:51.183 DEBUG 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是debug级别日志
2019-03-23 21:22:51.360  INFO 97534 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2019-03-23 21:22:51.381  INFO 97534 --- [           main] c.c.f.a.u.c.s.boot.logger.Application    : Started Application in 34.439 seconds (JVM running for 38.57)
2019-03-23 21:22:52.186  INFO 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是info级别日志
2019-03-23 21:22:52.186 ERROR 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是error级别日志
2019-03-23 21:22:52.186  WARN 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是warn级别日志
2019-03-23 21:22:52.186 DEBUG 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是debug级别日志
2019-03-23 21:22:53.190  INFO 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是info级别日志
2019-03-23 21:22:53.190 ERROR 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是error级别日志

发现2019-03-23 21:22:17.994 INFO 97534 --- [ main] c.c.f.apollo.core.MetaDomainConsts : Located meta server address http://localhost:8080 for env UNKNOWN from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider

但是通过常规方式部署apollo-quick-start是能测试改case的。

请教一下,这种应该如何调试?

@idoop
Copy link

idoop commented Mar 25, 2019

@Jiiiiiin 应该是环境地址给的有问题,同个容器中需要启动adminconfig两个服务才行.试试我的docker-apollo这个简单的镜像.

@Jiiiiiin
Copy link
Contributor Author

@idoop 谢谢 我也觉得应该是docker和本地网卡的原因,有时间还要仔细看看文档和Q&A,那您这个镜像和官方的有啥不同和优势,您能在这个issue介绍一下么?

@idoop
Copy link

idoop commented Mar 26, 2019

@Jiiiiiin 都在ReadMe里了,用法在Wiki中简单的写了几个.

@Jiiiiiin
Copy link
Contributor Author

@idoop 好的 谢谢 有时间我试试看

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

2 participants