{
“timestamp”: “2019-03-26T10:00:07.627+0000”,
“status”: 405,
“error”: “Method Not Allowed”,
“message”: “Request method ‘POST’ not supported”,
“path”: “/actuator/bus-refresh”
}
web路径也做了暴露配置:
management:
endpoints:
web:
exposure: #暴露 揭露
include: “*”
但是还是报405
最后发现是spring boot 以及spring cloud的版本太高了
当时创建的时候是在idea里面直接生成的spring-cloud-config,
idea直接给干到最新的版本了
后来把spring boot版本调到2.0.3.RELEASE
spring cloud 版本调到Finchley.RELEASE
在启动配置中心的时候就会有以下log:
再访问actuator/bus-refresh,就不报错了
配置通过总线刷新,只需在配置中心服务应用上访问如下链接,就能通知所有应用:
http://localhost:3301/actuator/bus-refresh
如果只想让某个应用更新:
http://localhost:3301/actuator/bus-refresh/pay-center:8086
其中3301是配置中心的端口
pay-center是具体的应用名
8086是pay-center中某个启动的应用的具体端口