sentinel 微服务流量治理工具,使用初步

官网入口        introduction | Sentinel 这是阿里巴巴的服务,中文支持很好

maven 配置入口  https://mvnrepository.com/artifact/com.alibaba.csp/sentinel-core


    com.alibaba.csp
    sentinel-core
    1.8.6

sentinel 控制台需要引入的依赖


    com.alibaba.csp
    sentinel-transport-simple-http
    1.8.6

这是 sentinel 公网演示包:

点击此处下载 Sentinel 公网 Demo jar 包

本地安装和启动

sentinel 微服务流量治理工具,使用初步_第1张图片

// 需要将  sentinel-dashboard.jar 包放在当前目录下

java -Dserver.port=8090 -Dcsp.sentinel.dashboard.server=localhost:8090 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard.jar

sentinel 微服务流量治理工具,使用初步_第2张图片

用户名: sentinel

密码: sentinel 

sentinel 微服务流量治理工具,使用初步_第3张图片

本地等路后的页面。

在微服务,没有和 sentinel 么有建立联系之前,监控的数据就是 sentinel 自己的服务。

在 pom 文件引入依赖


  com.alibaba.cloud
  spring-cloud-starter-alibaba-sentinel

之后,在 application.yaml 文件增加控制面板配置

spring:
  cloud:
    sentinel:
      transport:
        dashboard:  localhost:8090    # sentinel 控制面板的入口

⚠️ : 8090 端口根据个人配置调整

访问对应的微服务即可在控制台看到微服务的启动情况。

你可能感兴趣的:(微服务,Gateway,#Spring,sentinel,微服务,架构)