springboot2 集成Sentinel

springboot2 集成Sentinel,Sentinel的启动 运行,进程守护


项目框架:springboot2.1

项目构建:gradle 5.0

基于现有框架进行集成

一、gradle引入第三方jar  


/**
* sentinel jar 引入
*/
api("com.alibaba.csp:sentinel-transport-simple-http:1.5.2")
api('com.alibaba.csp:sentinel-datasource-nacos:1.5.2')
api('org.springframework.cloud:spring-cloud-starter-alibaba-sentinel:0.2.2.RELEASE')

如果是maven,可以自行去 (mvnrepository.com) 搜索。复制maven命令

attachments-2019-05-ogrw8HT65cf09cbddf5c1.png


attachments-2019-05-UQNJdCRO5cf09c4a96c8b.png


二、修改application.yml

  新增

    spring:
            application:
                name:whale-api(项目工程名,集成之后在控制台可以看到)
            # sentinel 配置
           cloud:
             sentinel:
                 transport:
                    dashboard: localhost:8081
                 eager: true     


三、启动Sentinel控制台,如何启动,请参考:

Sentinel的启动 运行,进程守护

attachments-2019-05-IFpHmvS65cf09a4d94629.png

四、Sentinel 基本介绍


参考链接: https://hellojava.cc/article/371

  • 发表于 2019-05-31 11:10
  • 阅读 ( 3660 )
  • 分类:Java

0 条评论

请先 登录 后评论
不写代码的码农
威猛的小站长

124 篇文章

作家榜 »

  1. 威猛的小站长 124 文章
  2. Jonny 65 文章
  3. 江南烟雨 36 文章
  4. - Nightmare 33 文章
  5. doublechina 31 文章
  6. HJ社区-肖峰 29 文章
  7. 伪摄影 22 文章
  8. Alan 14 文章