## springCloud config refresh刷新actuator踩坑

refresh刷新不起作用 404 actuator踩坑

Actuator

actuator是springboot中的一个附加功能,官方是对它这样介绍的:

Spring Boot includes a number of additional features to help you monitor and manage your application when you push it to production. You can choose to manage and monitor your application by using HTTP endpoints or with JMX. Auditing, health, and metrics gathering can also be automatically applied to your application.

用法:

1.引入依赖:

Maven方式:

org.springframework.boot spring-boot-starter-actuator

2 加配置(敲黑板

management:  #actuator
  server:
    port: 8081
  endpoints:
    web:
#      base-path: / #默认是/actuator 前缀,可以在这里修改
      exposure:
        include: "*"  #打开全部请求端点
#        include: refresh,health,info #打开部分

必须加上启动端口 2.0以后不加上启动端口报404

management:  #actuator
  server:
    port: 8081

3 加注解

@RefreshScope

4 手动刷新(敲黑板,搞了一上午没吃饭

2.0之前

curl -X POST http://localhost:1031/refresh
curl -X POST “http://localhost:1031/bus/refresh

2.0之以后

curl -v -X POST “http://localhost:8081/actuator/bus-refresh
curl -X POST “http://localhost:8081/actuator/bus-refresh
在这里插入图片描述
纯手打请给与支持

  • 7
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值