GithubHelp home page GithubHelp logo

first-springcloud's Introduction

First-SpringCloud

项目只是学习使用

Sentinel 使用

sentinel 是阿里出的关于服务熔断、服务降级、服务治理等的一个防护组件。Sentinel Github

1.本项目中,创建的服务cloudalibaba-sentinel-service8401,使用了Sentinel进项了防护

# yml配置
spring:
    sentinel:
      transport:
        # sentinel 地址
        dashboard: localhost:8858
        port: 8719
<!--  sentinel 和 canos 配合使用   -->
<dependencies>
    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
    </dependency>
    <dependency>
        <groupId>com.alibaba.cloud</groupId>
         <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    </dependency>
    <dependency>
        <groupId>com.alibaba.csp</groupId>
        <artifactId>sentinel-datasource-nacos</artifactId>
    </dependency>
</dependencies>

下载安装,目前我是用的是docker安装

# 下载 sentinel
docker pull bladex/sentinel-dashboard

运行sentinel

# 使用docker 运行sentinel,端口号为8858
docker run --name sentinel -d -p 8858:8858 -d bladex/sentinel-dashboard

安装完成,以及运行完成后,可以访问http:localhost:8858,即可看到Sentinel的界面,密码和账户都为:sentinel

注意:

  • 当设置流控规则的时候
    • 设置的是/testA 关联/testB的时候,如果资源/testB资源访问达到阀值的时候。/testA则会挂掉。而不是/testB

first-springcloud's People

Contributors

sevensecondmemoryfish avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.