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

[오류] p.397 port번호 변경이 되지 않습니다. #393

Closed
KyeongMoon opened this issue May 14, 2020 · 1 comment
Closed

[오류] p.397 port번호 변경이 되지 않습니다. #393

KyeongMoon opened this issue May 14, 2020 · 1 comment

Comments

@KyeongMoon
Copy link

KyeongMoon commented May 14, 2020

어떤 오류인가요?

오류설명: 무중단 배포를 실행하니 8080 포트로 배포가 됩니다.

처음에 heatlh.sh 에서 반복문을 나오지 못해 timeout이 발생하는 것을 확인했고,

netstat -lntp로 확인한 결과 8080포트로 배포된것이 원인인 것을 확인하였습니다.

codedeploy-agent-deployments.log에서 확인해보니 start.sh 의 IDLE_PROFILE은 real1으로 정상 출력이 되는데

8080포트로 배포가 되는 것을 보니 classpath:/application-IDLE_PROFILE.properties를 참조하지 못하는거같습니다.

jojoldu님 코드를 복사해 보는 등 많은 시간을 투자했는데 여전히 되지않네요...

대체 문제가 무엇일까요..

프로젝트 주소

Github에 오류가 난 프로젝트를 올려주세요.
Github 주소를 작성해주지 않으시면 답변해드릴수가 없어요!

오류 로그

[2020-05-14 16:59:46.715] [d-PNUDEICC3]LifecycleEvent - AfterInstall
[2020-05-14 16:59:46.715] [d-PNUDEICC3]Script - stop.sh
[2020-05-14 16:59:46.736] [d-PNUDEICC3][stdout]> 8081 에서 구동중인 애플리케이션 pid 확인
[2020-05-14 16:59:46.740] [d-PNUDEICC3][stdout]> 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다.
[2020-05-14 16:59:47.704] [d-PNUDEICC3]LifecycleEvent - ApplicationStart
[2020-05-14 16:59:47.705] [d-PNUDEICC3]Script - start.sh
[2020-05-14 16:59:47.714] [d-PNUDEICC3][stdout]> Build 파일 복사
[2020-05-14 16:59:47.714] [d-PNUDEICC3][stdout]> cp /home/ec2-user/app/step3/zip/*.jar /home/ec2-user/app/step3/
[2020-05-14 16:59:47.749] [d-PNUDEICC3][stdout]> 새 어플리케이션 배포
[2020-05-14 16:59:47.751] [d-PNUDEICC3][stdout]> JAR Name: /home/ec2-user/app/step3/freelec-springboot2-webservice-1.0.1-SNAPSHOT20200514075849.jar
[2020-05-14 16:59:47.751] [d-PNUDEICC3][stdout]> /home/ec2-user/app/step3/freelec-springboot2-webservice-1.0.1-SNAPSHOT20200514075849.jar 에 실행권한 추가
[2020-05-14 16:59:47.752] [d-PNUDEICC3][stdout]> /home/ec2-user/app/step3/freelec-springboot2-webservice-1.0.1-SNAPSHOT20200514075849.jar 실행
[2020-05-14 16:59:47.765] [d-PNUDEICC3][stdout]> /home/ec2-user/app/step3/freelec-springboot2-webservice-1.0.1-SNAPSHOT20200514075849.jar 를 profile=real1 로 실행합니다.
[2020-05-14 16:59:48.808] [d-PNUDEICC3]LifecycleEvent - ValidateService
[2020-05-14 16:59:48.808] [d-PNUDEICC3]Script - health.sh
[2020-05-14 16:59:48.915] [d-PNUDEICC3][stdout]> Health Check Start!
[2020-05-14 16:59:48.915] [d-PNUDEICC3][stdout]> IDLE_PORT: 8081
[2020-05-14 16:59:48.915] [d-PNUDEICC3][stdout]> curl -s http://localhost:8081/profile
[2020-05-14 16:59:58.975] [d-PNUDEICC3][stdout]> Health check의 응답을 알 수 없거나 혹은 실행 상태가 아닙니다.
[2020-05-14 16:59:58.975] [d-PNUDEICC3][stdout]> Health check:
[2020-05-14 16:59:58.976] [d-PNUDEICC3][stdout]> Health check 연결 실패. 재시도...
[2020-05-14 17:00:08.992] [d-PNUDEICC3][stdout]> Health check의 응답을 알 수 없거나 혹은 실행 상태가 아닙니다.
[2020-05-14 17:00:08.992] [d-PNUDEICC3][stdout]> Health check:
[2020-05-14 17:00:08.992] [d-PNUDEICC3][stdout]> Health check 연결 실패. 재시도...
[2020-05-14 17:00:19.006] [d-PNUDEICC3][stdout]> Health check의 응답을 알 수 없거나 혹은 실행 상태가 아닙니다.
[2020-05-14 17:00:19.006] [d-PNUDEICC3][stdout]> Health check:
[2020-05-14 17:00:19.006] [d-PNUDEICC3][stdout]> Health check 연결 실패. 재시도...
[2020-05-14 17:00:29.020] [d-PNUDEICC3][stdout]> Health check의 응답을 알 수 없거나 혹은 실행 상태가 아닙니다.
[2020-05-14 17:00:29.020] [d-PNUDEICC3][stdout]> Health check:
[2020-05-14 17:00:29.020] [d-PNUDEICC3][stdout]> Health check 연결 실패. 재시도...
[2020-05-14 17:00:39.034] [d-PNUDEICC3][stdout]> Health check의 응답을 알 수 없거나 혹은 실행 상태가 아닙니다.
[2020-05-14 17:00:39.034] [d-PNUDEICC3][stdout]> Health check:
[2020-05-14 17:00:39.034] [d-PNUDEICC3][stdout]> Health check 연결 실패. 재시도...

:: Spring Boot :: (v2.1.7.RELEASE)

2020-05-14 16:59:50.301 INFO 1612 --- [ main] com.jojodu.book.springboot.Application : Starting Application on freelec-springboot2-webservice with PID 1612 (/home/ec2-user/app/step3/freelec-springboot2-webservice-1.0.1-SNAPSHOT20200514075849.jar started by ec2-user in /opt/codedeploy-agent)
2020-05-14 16:59:50.315 INFO 1612 --- [ main] com.jojodu.book.springboot.Application : The following profiles are active: oauth,real1
2020-05-14 16:59:53.022 INFO 1612 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2020-05-14 16:59:53.213 INFO 1612 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 175ms. Found 2 repository interfaces.
2020-05-14 16:59:54.487 INFO 1612 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ccab0d8d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-05-14 16:59:55.275 INFO 1612 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-05-14 16:59:55.364 INFO 1612 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-05-14 16:59:55.364 INFO 1612 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.22]
2020-05-14 16:59:55.580 INFO 1612 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-05-14 16:59:55.580 INFO 1612 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 5100 ms
2020-05-14 16:59:56.076 INFO 1612 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-05-14 16:59:56.348 INFO 1612 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-05-14 16:59:56.476 INFO 1612 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2020-05-14 16:59:56.652 INFO 1612 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.10.Final}
2020-05-14 16:59:56.654 INFO 1612 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2020-05-14 16:59:56.951 INFO 1612 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
2020-05-14 16:59:57.466 INFO 1612 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2020-05-14 16:59:59.035 INFO 1612 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-05-14 16:59:59.972 INFO 1612 --- [ main] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
2020-05-14 17:00:01.477 INFO 1612 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@1852a3ff, org.springframework.security.web.context.SecurityContextPersistenceFilter@16c63f5, org.springframework.security.web.header.HeaderWriterFilter@5f0e9815, org.springframework.security.web.authentication.logout.LogoutFilter@28ec166e, org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter@4dd02341, org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter@55dfcc6, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@74eb909f, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@7203c7ff, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6d3c5255, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@4879dfad, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@25bfcafd, org.springframework.security.web.session.SessionManagementFilter@126945f9, org.springframework.security.web.access.ExceptionTranslationFilter@50468873, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@6bbe2511]
2020-05-14 17:00:02.448 INFO 1612 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-05-14 17:00:02.576 WARN 1612 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : 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
2020-05-14 17:00:02.695 INFO 1612 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2020-05-14 17:00:03.258 INFO 1612 --- [ main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing
2020-05-14 17:00:03.344 INFO 1612 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2020-05-14 17:00:03.345 INFO 1612 --- [ main] com.jojodu.book.springboot.Application : Started Application in 14.4 seconds (JVM running for 15.572)
2020-05-14 17:12:20.096 INFO 1612 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-05-14 17:12:20.096 INFO 1612 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2020-05-14 17:12:20.118 INFO 1612 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 22 ms

@KyeongMoon
Copy link
Author

자답하겠습니다.
문제는 application-real1.properties 의 위치가 test의 resources에 들어있었습니다.
모든 패키지 다 열어놓고 코딩하다보니 자연스래 제일 아래가 main의 resources로 생각했네요 ;;

start.sh
-Dspring.config.location=classpath:/application-$IDLE_PROFILE.properties 에서
$IDLE_PROFILE 이 real1 임에도 불구하고 해당 파일이 없다고 오류가 따로 출력되지 않고 실행이 된듯 합니다.

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

No branches or pull requests

2 participants