微服务整合sentinel

62 阅读1分钟

1.引入sentinel依赖:

<!--引入sentinel依赖-->
<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
  1. 配置控制台地址(让微服务与控制台建立联系):

spring:
  cloud:
    sentinel:
      transport:
        dashboard: localhost:8080    # sentinel控制台地址

(如果是在云服务器上安装的sentinel,localhost改为服务器的ip地址)