springcloud-alibaba Sentinel入门

Releases · alibaba/Sentinel · GitHubSentinel下载官方

在cmd 里面运行 启动命令

java -jar sentinel-dashboard-1.8.6.jar

启动成功前提 java环境 ,已经注册到服务注册中心,8080端口没有被占用

启动后访问地址为

qhttp://localhost:8080http://localhost:8080登录密码均为sentinel

maven依赖

XML 复制代码
   <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
        </dependency>
        <!--nacos-discovery-->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        </dependency>

yaml配置

XML 复制代码
server:
  port: 8401

spring:
  application:
    name: cloudalibaba-sentinel-service
  cloud:
    nacos:
      discovery:
        server-addr: localhost:8848         #Nacos服务注册中心地址
    sentinel:
      transport:
        dashboard: localhost:8080 #配置Sentinel dashboard控制台服务地址
        port: 8719 #默认8719端口,假如被占用会自动从8719开始依次+1扫描,直至找到未被占用的端口

Sentinel采用的是懒加载机制,需要访问几次接口才能在界面中看到服务

相关推荐
Flittly9 小时前
【AgentScope Java新手村系列】(16)从RAG到多路检索
java·spring boot·spring
咖啡八杯1 天前
GoF设计模式——中介者模式
java·后端·spring·设计模式
Flittly3 天前
【AgentScope Java新手村系列】(14)人机交互
java·spring boot·spring
吃饱了得干活3 天前
Spring Cloud Gateway 微服务网关:路由、断言、过滤器
java·spring cloud
唐青枫7 天前
Java Spring WebFlux 实战指南:用 Mono、Flux 和 WebClient 写响应式接口
java·spring
咖啡八杯8 天前
GoF设计模式——策略模式
java·后端·spring·设计模式
Flittly9 天前
【AgentScope Java新手村系列】(11)中断与恢复
java·spring boot·spring
dunky10 天前
Spring 的三级缓存与循环依赖
后端·spring
码云数智-园园14 天前
C++20 Modules 模块详解
java·开发语言·spring
咖啡八杯14 天前
GoF设计模式——享元模式
java·spring·设计模式·享元模式