1、springboot版本2.1.3
2、pom.xml加了
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
3、application.properties加了
management.endpoints.shutdown.enabled=true
management.endpoints.shutdown.sensitive=false
management.endpoints.web.exposure.include=*
4、请求http://127.0.0.1:8222/actuator/
返回值:
{
"_links": {
"self": {
"href": "http://127.0.0.1:8222/actuator",
"templated": false
},
"auditevents": {
"href": "http://127.0.0.1:8222/actuator/auditevents",
"templated": false
},
"beans": {
"href": "http://127.0.0.1:8222/actuator/beans",
"templated": false
},
"caches-cache": {
"href": "http://127.0.0.1:8222/actuator/caches/{cache}",
"templated": true
},
"caches": {
"href": "http://127.0.0.1:8222/actuator/caches",
"templated": false
},
"health-component-instance": {
"href": "http://127.0.0.1:8222/actuator/health/{component}/{instance}",
"templated": true
},
"health": {
"href": "http://127.0.0.1:8222/actuator/health",
"templated": false
},
"health-component": {
"href": "http://127.0.0.1:8222/actuator/health/{component}",
"templated": true
},
"conditions": {
"href": "http://127.0.0.1:8222/actuator/conditions",
"templated": false
},
"configprops": {
"href": "http://127.0.0.1:8222/actuator/configprops",
"templated": false
},
"env-toMatch": {
"href": "http://127.0.0.1:8222/actuator/env/{toMatch}",
"templated": true
},
"env": {
"href": "http://127.0.0.1:8222/actuator/env",
"templated": false
},
"info": {
"href": "http://127.0.0.1:8222/actuator/info",
"templated": false
},
"loggers": {
"href": "http://127.0.0.1:8222/actuator/loggers",
"templated": false
},
"loggers-name": {
"href": "http://127.0.0.1:8222/actuator/loggers/{name}",
"templated": true
},
"heapdump": {
"href": "http://127.0.0.1:8222/actuator/heapdump",
"templated": false
},
"threaddump": {
"href": "http://127.0.0.1:8222/actuator/threaddump",
"templated": false
},
"metrics": {
"href": "http://127.0.0.1:8222/actuator/metrics",
"templated": false
},
"metrics-requiredMetricName": {
"href": "http://127.0.0.1:8222/actuator/metrics/{requiredMetricName}",
"templated": true
},
"scheduledtasks": {
"href": "http://127.0.0.1:8222/actuator/scheduledtasks",
"templated": false
},
"httptrace": {
"href": "http://127.0.0.1:8222/actuator/httptrace",
"templated": false
},
"mappings": {
"href": "http://127.0.0.1:8222/actuator/mappings",
"templated": false
}
}
}
并没有shutdown,post请求http://127.0.0.1:8222/actuator/shutdown也报404,请求是哪里还需要配置吗?