1.centos7
2.spring boot 2.0
spring cloud config server /bus/refresh 404 not found
Spring boot 2.0的改动较大,/bus/refresh全部整合到actuator里面了,变成了/actuator/bus-refresh,所以之前1.x的management.security.enabled全部失效,不适用于2.0
2.0的properties配置是这样的:
management:
endpoints:
web:
exposure:
include: bus-refresh
另外在config-client Application注解
@RefreshScope
注意:config-server和config-client的配置都需要加上
management:
endpoints:
web:
exposure:
include: bus-refresh
然后再通常查找日志可发现有该[/actuator/bus-refresh],methods=[POST] 日志,通过访问使用curl即可刷新config-server从远端Git拉取修改后的配置:
curl -v -X POST "http://localhost:8888/actuator/bus-refresh"