# springcloud-sentinel **Repository Path**: kindwgy2023/springcloud-sentinel ## Basic Information - **Project Name**: springcloud-sentinel - **Description**: springcloud集成sentinel实现流量控制,熔断降级等微服务保护 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2023-05-30 - **Last Updated**: 2023-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # springcloud-sentinel #### 介绍 springcloud集成sentinel实现流量控制,熔断降级等微服务保护 #### 软件架构 软件架构说明 #### 安装教程 1. 启动nacos 2. 因应该启动时是先加载配置bootstrap.yaml,再载application.yaml 把nacos配置单独放到bootstrap.yaml即可。 spring: application: name: userservice profiles: active: dev # 环境 cloud: nacos: server-addr: 127.0.0.1:8848 # nacos地址 username: nacos password: nacos file-extension: yaml # 文件后缀名 3,分别启动OrderApplication、UserApplication、GatewayApplication #### 使用说明 1.在gateway服务中的application.yml中新增: - AddRequestHeader=origin,gateway #添加名为origin的请求头,值为gateway 2.以下代码获取请求头中的参数origin 3.在sentinel中http://localhost:8090/对 /order/{orderId},点击授权,填写gateway 4.如果直接访问http://localhost:8081/order/101,就会被限流Blocked by Sentinel (flow limiting) 5.必须经过网关才能访问该接口/order/{orderId} http://localhost:10010/order/101?authorization=admin #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)