zoukankan      html  css  js  c++  java
  • 服务容错-Sentinel

    1、什么是Sentinel

    Sentinel轻量级的流量控制,熔断降级Java库。面向云原生微服务的高可用流控防护组件

    https://github.com/alibaba/Sentinel

    2、集成Sentinel

    在Order服务中集成Sentinel

    增加依赖

            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
            </dependency>
    
            <!-- /actuator/sentinel-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
    

      

    增加配置

    访问Order服务

    http://192.168.20.108:8071/order/actuator/sentinel

    3、Sentinel控制台安装 

    https://github.com/alibaba/Sentinel/releases

    下载版本 1.6.3 (与集成的版本保持一致)

    https://github.com/alibaba/Sentinel/releases/tag/1.6.3

    下载: sentinel-dashboard-1.6.3.jar

     放在D:Toolssentinel

    cd D:Toolssentinel

    java -jar sentinel-dashboard-1.6.3.jar

    打开客户端:  http://localhost:8080 用户名和密码分别为sentinel和sentinel

    Order服务整合Sentinel控制台

    指定Sentinel控制台的地址。

    再次查看 http://localhost:8080,还是和原来一样,空白的页面

    调用一个order服务的接口,如http://localhost:8071/order/prod/1

    再次查看 http://localhost:8080,已经有了Order服务,说明Sentinel是懒加载的。

  • 相关阅读:
    myeclipse的git插件安装
    安装虚拟机和Linux系统
    Windows 10快速在指定目录打开命令行
    更新Maven的本地库
    Maven安装
    html全屏显示
    除法保留两位小数
    springmvcjson中文乱码处理
    office2016 下载直通车
    JAVA面向对象编程深入理解图
  • 原文地址:https://www.cnblogs.com/linlf03/p/14241665.html
Copyright © 2011-2022 走看看