当前位置:网站首页>【微服务|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: '*'
成功启动

边栏推荐
- MySQL日志管理
- Collective example
- Fuxin Kunpeng joins in, and dragon lizard community welcomes a new partner in format document technical service
- 【面试题】instancof和getClass()的区别
- 2021-11-05
- Report on operation pattern and future prospect of global and Chinese propyl isovalerate industry from 2022 to 2028
- [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
- Technologie des fenêtres coulissantes en octets dans la couche de transmission
- Helm chart仓库操作
- MySQL log management
猜你喜欢
Hyperledger Fabric 2. X dynamic update smart contract
How can I persuade leaders to use DDD to construct the liver project?
![[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](/img/95/02a58c9dc97bd8347b43247e38357d.png)
[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
Microsoft won the title of "leader" in the magic quadrant of Gartner industrial Internet of things platform again!

ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string

In the process of enterprise development, I found that a colleague used the select * from where condition for update

Svg+js keyboard control path

Registration method of native method in JNI
How to use promise Race() and promise any() ?

VNC viewer remote connection raspberry pie without display
随机推荐
Usage of assert
Do280openshift access control -- encryption and configmap
Related operations of ansible and Playbook
The picture of wechat official account can not be displayed normally
iNFTnews | 国内NFT发展仅限于数字藏品吗?
傳輸層 以字節為單比特的滑動窗口技術
vim使用命令
[issue 25] face to face experience of golang Engineer in the rightmost social recruitment
Adding, deleting, modifying and checking in low build code
Current situation analysis and development trend prediction report of hesperidase industry in the world and China from 2022 to 2028
Interesting checkbox counters
VNC viewer remote connection raspberry pie without display
wx小程序跳转页面
Signal integrity (SI) power integrity (PI) learning notes (XXV) differential pair and differential impedance (V)
Basic summary of MySQL database knowledge
Unimportant tokens can be stopped in advance! NVIDIA proposes an efficient visual transformer network a-vit with adaptive token to improve the throughput of the model
Binder mechanism and Aidl communication example
Go crawler framework -colly actual combat (IV) -- Zhihu answer crawl (I)
linux 系统redis常用命令
After 5 years of software testing in didi and ByteDance, it's too real