spring 启动了两个tomcat 端口 原因定位分析

服务启动了两个tomcat

ligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-09-24 18:22:54.847 | INFO | restartedMain | org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker | PostProcessorRegistrationDelegate.java:335 | Bean 'org.springframework.retry.annotation.RetryConfiguration' of type [org.springframework.retry.annotation.RetryConfiguration1346cc76] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-09-24 18:22:56.626 | INFO | restartedMain | org.springframework.boot.web.embedded.tomcat.TomcatWebServer | TomcatWebServer.java:108 | Tomcat initialized with port(s): 8093 (http)
2022-09-24 18:22:56.636 | INFO | restartedMain | org.apache.coyote.http11.Http11NioProtocol | DirectJDKLog.java:173 | Initializing ProtocolHandler ["http-nio-8093"]
2022-09-24 18:22:56.637 | INFO | restartedMain | org.apache.catalina.core.StandardService | DirectJDKLog.java:173 | Starting service [Tomcat]
2022-09-24 18:22:56.637 | INFO | restartedMain | org.apache.catalina.core.StandardEngine | DirectJDKLog.java:173 | Starting Servlet engine: [Apache Tomcat/9.0.39]
2022-09-24 18:22:56.792 | INFO | restartedMain | org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] | DirectJDKLog.java:173 | Initializing Spring embedded WebApplicationContext

2022-09-24 18:23:15.567 | INFO | restartedMain | org.springframework.boot.web.embedded.tomcat.TomcatWebServer | TomcatWebServer.java:220 | Tomcat started on port(s): 8081 (http) with context path '/monitor'

这里我们看到 spring 初始化了两个 tomcat 端口 一个是8081 一个是8093端口

两个端口都是能通的 在服务器来之后
可以看到8093比8081起来找

两个都是通过类 tomcatWebServer 答应的日志 区别是一个是108行 一个是220行

一个是
Tomcat initialized with port(s):

一个是
Tomcat started on port(s): 8081

原来我们在yml里配置了
server:
port: 8093

servlet-path: ${spring.application.path}/*

management:

监控端口路径及路径

server:
port: 8081

监控的端口和普通的url端口区分开了 ,这样就防止了 一些敏感的信息外泄.

你可能感兴趣的:(spring 启动了两个tomcat 端口 原因定位分析)