暂停点不可用

时间:2019-07-07 09:53:55

标签: spring-cloud spring-boot-actuator

我正在使用具有以下云依赖性的Finchley.SR1

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-commons</artifactId>
        </dependency>

I have enabled pause config like this
 endpoints:
  restart:
    enabled: true    
  pause:
    enabled: true  

仍然没有暂停,并且恢复端点可用,就像执行器一样

{"_links":{"self":{"href":"http://localhost:18182/actuator","templated":false},"archaius":{"href":"http://localhost:18182/actuator/archaius","templated":false},"auditevents":{"href":"http://localhost:18182/actuator/auditevents","templated":false},"beans":{"href":"http://localhost:18182/actuator/beans","templated":false},"health":{"href":"http://localhost:18182/actuator/health","templated":false},"conditions":{"href":"http://localhost:18182/actuator/conditions","templated":false},"configprops":{"href":"http://localhost:18182/actuator/configprops","templated":false},"env-toMatch":{"href":"http://localhost:18182/actuator/env/{toMatch}","templated":true},"env":{"href":"http://localhost:18182/actuator/env","templated":false},"info":{"href":"http://localhost:18182/actuator/info","templated":false},"loggers":{"href":"http://localhost:18182/actuator/loggers","templated":false},"loggers-name":{"href":"http://localhost:18182/actuator/loggers/{name}","templated":true},"heapdump":{"href":"http://localhost:18182/actuator/heapdump","templated":false},"threaddump":{"href":"http://localhost:18182/actuator/threaddump","templated":false},"metrics":{"href":"http://localhost:18182/actuator/metrics","templated":false},"metrics-requiredMetricName":{"href":"http://localhost:18182/actuator/metrics/{requiredMetricName}","templated":true},"scheduledtasks":{"href":"http://localhost:18182/actuator/scheduledtasks","templated":false},"httptrace":{"href":"http://localhost:18182/actuator/httptrace","templated":false},"mappings":{"href":"http://localhost:18182/actuator/mappings","templated":false},"refresh":{"href":"http://localhost:18182/actuator/refresh","templated":false},"features":{"href":"http://localhost:18182/actuator/features","templated":false},"service-registry":{"href":"http://localhost:18182/actuator/service-registry","templated":false},"bindings-name":{"href":"http://localhost:18182/actuator/bindings/{name}","templated":true},"bindings":{"href":"http://localhost:18182/actuator/bindings","templated":false},"channels":{"href":"http://localhost:18182/actuator/channels","templated":false}}

1 个答案:

答案 0 :(得分:0)

自Spring Boot 2.0起,端点配置属性已更改。 要启用/actuator/restart/actuator/pause/actuator/resume,您需要使用management.endpoint.restart.enabled=true。 另外,请不要忘记在management.endpoints.web.exposure.include中包含这些端点。