赞
踩
在sentinel对应目录,打开命令行(cmd),启动运行sentinel
java -Dserver.port=8180 -Dcsp.sentinel.dashboard.server=localhost:8180 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard-1.8.1.jar
<!--假如网关层面进行限流,添加如下依赖-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
</dependency>
启动时,添加sentinel的jvm参数,通过此菜单可以让网关服务在sentinel控制台显示不一样的菜单,代码如下。
-Dcsp.sentinel.app.type=1
![在这里插入图片描述](https://img-blog.csdnimg.cn/294d750b3716453dac35e6a08bc63267.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,s
说明,假如没有发现请求链路,API管理,关闭网关项目,关闭sentinel,然后重启sentinel,重启网关项目.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。