1. springboot版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.5</version>
</parent>
2. 添加sentinel依赖
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
<version>2021.0.1.0</version>
</dependency>
3. yaml添加配置
spring:
cloud:
sentinel:
transport:
dashboard: you-sentinel-svc:8080 #你的dashboard控制台地址
eager: true #取消Sentinel控制台懒加载(按需配置)