[스프링] Web server failed to start. Port 8092 was already in use.
프로그래밍/서버2021. 1. 5. 16:10
Spring에서 zuul을 돌리는데 아래의 에러가 발생했습니다.
2021-01-05 00:43:52.551 INFO 193308 --- [ restartedMain] o.s.c.n.e.s.EurekaServiceRegistry : Registering application MSA-API-GATEWAY with eureka with status UP
2021-01-05 00:43:52.552 INFO 193308 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1609775032552, current=UP, previous=STARTING]
2021-01-05 00:43:52.555 INFO 193308 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MSA-API-GATEWAY/host.docker.internal:msa-api-gateway:8092: registering service...
2021-01-05 00:43:52.599 INFO 193308 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MSA-API-GATEWAY/host.docker.internal:msa-api-gateway:8092 - registration status: 204
2021-01-05 00:43:52.611 WARN 193308 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8092 is already in use
2021-01-05 00:43:52.611 INFO 193308 --- [ restartedMain] o.s.c.n.zuul.ZuulFilterInitializer : Stopping filter initializer
2021-01-05 00:43:52.614 INFO 193308 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-01-05 00:43:52.634 INFO 193308 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2021-01-05 00:43:55.638 INFO 193308 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Unregistering ...
2021-01-05 00:43:55.643 INFO 193308 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : DiscoveryClient_MSA-API-GATEWAY/host.docker.internal:msa-api-gateway:8092 - deregister status: 200
2021-01-05 00:43:55.656 INFO 193308 --- [ restartedMain] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2021-01-05 00:43:55.658 INFO 193308 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-01-05 00:43:55.685 INFO 193308 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-05 00:43:55.692 ERROR 193308 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 8092 was already in use.
Action:
Identify and stop the process that's listening on port 8092 or configure this application to listen on another port.
해당 앱에서 사용하는 서버 포트가 8092인데 이게 사용 중이라고 에러가 발생하네요.
포트 번호를 바꿔도 증상은 똑같았습니다.
몇 가지 변화를 주면서 발견한 사실은 아래와 같습니다.
스프링 부트 버전 | 스프링 클라우드 버전 | 동작 여부 |
2.1.5.RELEASE | Greenwich.SR1 | O |
2.3.4.RELEASE | Hoxton.SR8 | X |
2.3.4.RELEASE | Hoxton.SR9 | X |
2.3.7.RELEASE | Hoxton.SR9 | O |
정확한 이유는 모르겠으나 공식 홈페이지에 호환 가능하다고 되어있는 버전도 최신? 버전이 아니면 뭔가 문제가 있는 것 같습니다.
아.. 그런데 거의 동일한 설정을 한 프로젝트인데 다른 프로젝트에선 여전히 에러가 발생하네요.
이상합니다.. 재부팅을 하고 났더니 갑자기 모든 설정에서 잘 되네요;
윈도우 리소스 모니터로 포트 확인하면서 했기에
문제가 있었을 때, 이미 포트가 사용중인 문제는 아니었습니다.
흠.. 신기한 증상이네요.
참고
spring.io/projects/spring-cloud
댓글 영역