当前位置:网站首页>【微服务|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: '*'
成功启动
边栏推荐
- Collection of software testing and game testing articles
- 传输层 以字节为单位的滑动窗口技术
- How to use promise Race() and promise any() ?
- Simple collation of Web cache
- Apk slimming compression experience
- 【排行榜】Carla leaderboard 排行榜 运行与参与手把手教学
- What is the difference between one way and two way ANOVA analysis, and how to use SPSS or prism for statistical analysis
- A small program written this week
- 【面试题】什么是事务,什么是脏读、不可重复读、幻读,以及MySQL的几种事务隔离级别的应对方法
- Requests Library
猜你喜欢
C WinForm maximizes occlusion of the taskbar and full screen display
UE4 WebBrowser图表不能显示问题
Use of JMeter
Usage of ViewModel and livedata in jetpack
Alternative to log4j
Fuxin Kunpeng joins in, and dragon lizard community welcomes a new partner in format document technical service
Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181
离散数学及其应用 2018-2019学年春夏学期期末考试 习题详解
Apk decompiled method (not confused)
Working principle analysis of kubernetes architecture core components
随机推荐
Is it so difficult to calculate the REM size of the web page according to the design draft?
Applet opening traffic master
[interview question] what is a transaction? What are dirty reads, unrepeatable reads, phantom reads, and how to deal with several transaction isolation levels of MySQL
iNFTnews | 国内NFT发展仅限于数字藏品吗?
Paint rounded rectangle
D manual destruction may violate memory security
离散数学及其应用 2018-2019学年春夏学期期末考试 习题详解
MySQL semi sync replication
Overview of medium and low speed aerospace electronic bus
Use of JMeter
Eliminate duplicate dependencies
Unmanned driving: Some Thoughts on multi-sensor fusion
Single blind box removal, social blind box and friend blind box program source code
Alternative to log4j
水库大坝安全监测
打卡smart精灵#1,品牌不缺吸引力,产品本身实力如何?
传输层 以字节为单位的滑动窗口技术
VIM use command
Helm chart warehouse operation
Meta & Berkeley proposed a universal multi-scale visual transformer based on pooled self attention mechanism. The classification accuracy in Imagenet reached 88.8%! Open source