Sentinel

目录

1、下载启动

2、修改默认配置

​3、微服务项目使用Sentinel

3.1  加入依赖

 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

相关文章

显卡天梯图2024最新版,显卡是电脑进行图形处理的重要设备,...
初始化电脑时出现问题怎么办,可以使用win系统的安装介质,连...
todesk远程开机怎么设置,两台电脑要在同一局域网内,然后需...
油猴谷歌插件怎么安装,可以通过谷歌应用商店进行安装,需要...
虚拟内存这个名词想必很多人都听说过,我们在使用电脑的时候...