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是懒加载的。

  • 相关阅读:
    视图中访问 路由参数
    视图中的Layout使用(转)
    js判断浏览器类型以及版本
    再关于IE11
    关于IE11
    js获取当前页面的网址域名地址
    contenteditable 属性
    HTMl5的sessionStorage和localStorage(转)
    c 数组做为形參时 该參数退化为指针
    汉诺塔-递归实现
  • 原文地址:https://www.cnblogs.com/linlf03/p/14241665.html
Copyright © 2011-2022 走看看