spring 啟動了兩個tomcat 端口 原因定位分析

服務(wù)啟動了兩個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.RetryConfigurationEnhancerBySpringCGLIB1346cc76] 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端口

兩個端口都是能通的 在服務(wù)器來之后
可以看到8093比8081起來找

兩個都是通過類 tomcatWebServer 答應(yīng)的日志 區(qū)別是一個是108行 一個是220行

一個是
Tomcat initialized with port(s):

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

原來我們在yml里配置了
server:
port: 8093

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

management:

監(jiān)控端口路徑及路徑

server:
port: 8081

監(jiān)控的端口和普通的url端口區(qū)分開了 ,這樣就防止了 一些敏感的信息外泄.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容