Sentinel环境搭建

发布时间 2023-12-19 10:33:04作者: 梅丹隆

一、Sentinel控制台

详见:Docker安装Sentinel

二、SpringBoot集成

1、依赖

<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>

2、配置

management:
  endpoints:
    web:
      exposure:
        include: '*'
spring:
  cloud:
    sentinel:
      transport:
        dashboard: localhost:8858
      filter:
        enabled: false
        url-patterns: /**
server:
  port: 9000

3、注解

无注解

三、使用Sentinel进行流控