目录
3.2 修改 bootstrap.properties 或 application.properties 配置文件
3.3 sentinel默认只对controller层的接口生成簇点链路,在server层使用需:
1、下载启动
启动命令:
java -jar sentinel-dashboard-1.8.1.jar
2、修改默认配置
修改端口并启动:
java -Dserver.port=8090 -jar sentinel-dashboard-1.8.1.jar
3、微服务项目使用Sentinel
3.1 加入依赖
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
3.2 修改 bootstrap.properties 或 application.properties 配置文件
# 配置sentinel控制台地址
spring.cloud.sentinel.transport.dashboard=localhost:9090
3.3 sentinel默认只对controller层的接口生成簇点链路,在server层使用需:
(1)使用@SentinelResource注解
//注解
@SentinelResource("queryGoods")
(2)修改配置类
spring.cloud.sentinel.web-context-unify=false