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

边栏推荐
- OTT营销之风正盛,商家到底该怎么投?
- Xcode预览(Preview)显示List视图内容的一个Bug及解决
- D omit parameter name
- UE4 WebBrowser chart cannot display problems
- 无需显示屏的VNC Viewer远程连接树莓派
- Analysis report on operation trend and investment strategy of global and Chinese tetrahydrofurfuryl propionate industry from 2022 to 2028
- Solution to network access packet loss of Tencent cloud international ECS
- Overview of medium and low speed aerospace electronic bus
- 2021-11-05
- Qiniu cloud uploads video to get the first frame of video
猜你喜欢

Signal integrity (SI) power integrity (PI) learning notes (XXV) differential pair and differential impedance (V)

ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string
[distributed system design profile (2)] kV raft

Meta&伯克利基于池化自注意力机制提出通用多尺度视觉Transformer,在ImageNet分类准确率达88.8%!开源...

Ott marketing is booming. How should businesses invest?

Dynamic effect of canvas lines

Time unified system

Working principle analysis of kubernetes architecture core components

JMeter socket connection sends data

C WinForm maximizes occlusion of the taskbar and full screen display
随机推荐
Use coordinatorlayout+appbarlayout+collapsingtoolbarlayout to create a collapsed status bar
Paper review: U2 net, u-net composed of u-net
Interesting checkbox counters
Use of navigation and navigationui
Go crawler framework -colly actual combat (III) -- panoramic cartoon picture capture and download
Eliminate duplicate dependencies
On the difficulty of developing large im instant messaging system
Transition from digitalization to intelligent manufacturing
2021-04-18
ServerSocket and socket connection
Uniapp encapsulated incentive advertisement, screen insert advertisement and banner advertisement
MySQL semi sync replication
Working principle analysis of kubernetes architecture core components
iNFTnews | 国内NFT发展仅限于数字藏品吗?
Network request -volley
[distributed system design profile (2)] kV raft
Use of JMeter easynmon
离散数学及其应用 2018-2019学年春夏学期期末考试 习题详解
Design scheme of authority management of fusion model
微搭低代码中实现增删改查