当前位置:网站首页>【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
2022-06-24 20:01:00 【步尔斯特】
简介
Sentinel 是面向分布式、多语言异构化服务架构的流量治理组件,主要以流量为切入点,从流量路由、流量控制、流量整形、熔断降级、系统自适应过载保护、热点流量防护等多个维度来帮助开发者保障微服务的稳定性。
时间线
2019 年,Sentinel 朝着多语言扩展的方向不断探索,推出 C++ 原生版本,同时针对 Service Mesh 场景也推出了 Envoy 集群流量控制支持,以解决 Service Mesh 架构下多语言限流的问题。
2021 年,Sentinel 正在朝着 2.0 云原生高可用决策中心组件进行演进;同时推出了 Sentinel Rust 原生版本。
2022 年,Sentinel 品牌升级为流量治理,领域涵盖流量路由/调度、流量染色、流控降级、过载保护/实例摘除等;同时社区将流量治理相关标准抽出到 OpenSergo 标准中,Sentinel 作为流量治理标准实现。
两大模块
Sentinel 的使用可以分为两个部分:
控制台(Dashboard):控制台主要负责管理推送规则、监控、集群限流分配管理、机器发现等。
核心库(Java 客户端):不依赖任何框架/库,能够运行于 Java 7 及以上的版本的运行时环境,同时对 Dubbo / Spring Cloud 等框架也有较好的支持。
工作流程图

sentinel-dashboard-1.8.1镜像
Dockerfile
FROM java:8
LABEL maintainer="issa <[email protected]>"
ADD sentinel-dashboard-1.8.1.jar app.jar
EXPOSE 80
ENTRYPOINT ["java" ,"-Dserver.port=80","-Dcsp.sentinel.dashboard.server=localhost:80","-Dproject.name=mysentinel","-jar", "app.jar"]
前提条件:需要将sentinel-dashboard-1.8.1.jar上传至当前目录下。
执行如下命令完成镜像的创建docker build -t mysentinel:1.8.1 .
运行docker run -d -p 80:80 mysentinel:1.8.1
控制台
Sentinel 提供一个轻量级的开源控制台,它提供机器发现以及健康情况管理、监控(单机和集群),规则管理和推送的功能。
Sentinel 控制台包含如下功能:
查看机器列表以及健康情况:收集 Sentinel 客户端发送的心跳包,用于判断机器是否在线。
监控 (单机和集群聚合):通过 Sentinel 客户端暴露的监控 API,定期拉取并且聚合应用监控信息,最终可以实现秒级的实时监控。
规则管理和推送:统一管理推送规则。
鉴权:生产环境中鉴权非常重要。这里每个开发者需要根据自己的实际情况进行定制。
注意:Sentinel 控制台目前仅支持单机部署。Sentinel 控制台项目提供 Sentinel
功能全集示例,不作为开箱即用的生产环境控制台,若希望在生产环境使用请根据文档自行进行定制和改造。
sentinel控制台接入代码
依赖
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
配置文件:
spring:
cloud:
sentinel:
transport:
dashboard: localhost
# port: 8719
# client-ip: localhost
eager: true
management:
endpoints:
web:
exposure:
include: '*'
成功启动

边栏推荐
- ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’
- The drawableleft of the custom textview in kotlin is displayed in the center together with the text
- 2021-11-05
- iNFTnews | 国内NFT发展仅限于数字藏品吗?
- Usage of assert
- Go crawler framework -colly actual combat (4) -- Zhihu answer crawl (2) -- visual word cloud
- Binder mechanism and Aidl communication example
- What is test development? Can you find a job at this stage?
- [Solved] Public key for mysql-community-xxx. rpm is not installed
- What is the difference between one way and two way ANOVA analysis, and how to use SPSS or prism for statistical analysis
猜你喜欢

Infotnews | is the development of domestic NFT limited to digital collections?

JDBC —— 数据库连接
5-minute NLP: summary of 3 pre training libraries for rapid realization of NER

I suddenly find that the request dependent package in NPM has been discarded. What should I do?
Is it so difficult to calculate the REM size of the web page according to the design draft?

无需显示屏的VNC Viewer远程连接树莓派
How can I persuade leaders to use DDD to construct the liver project?

ServerSocket and socket connection

UE4 WebBrowser图表不能显示问题

傳輸層 以字節為單比特的滑動窗口技術
随机推荐
Analysis report on development trend and investment forecast of global and Chinese D-leucine industry from 2022 to 2028
MySQL log management
Ott marketing is booming. How should businesses invest?
Why are life science enterprises on the cloud in succession?
How to delete the entire row with duplicate items in a column of WPS table
Go crawler framework -colly actual combat (II) -- Douban top250 crawling
Use and click of multitypeadapter in recycleview
The problem of multiple callback of video ads stimulated by applets (offcolse problem)
无人驾驶: 对多传感器融合的一些思考
C程序设计专题 18-19年期末考试习题解答(下)
Jar package merging using Apache ant
Uniapp encapsulated incentive advertisement, screen insert advertisement and banner advertisement
离散数学及其应用 2018-2019学年春夏学期期末考试 习题详解
Scrollview height cannot fill full screen
linux 系统redis常用命令
What is the difference between one way and two way ANOVA analysis, and how to use SPSS or prism for statistical analysis
融合模型权限管理设计方案
How to quickly open traffic master for wechat applet
2021-04-18
ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’