Skip to Content
微服务与事件驱动架构
book

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
使用重量级框架的微服务
153
11.7.2
 通过重启伸缩应用程序
第二个策略是通过重启对应用程序进行伸缩,所有的重量级流框架都支持该策略。流的消
费会暂停,应用程序会创建检查点,然后停止程序。接下来,使用新的资源和并行度重新
初始化应用程序,并根据需要从检查点重新加载有状态数据。例如,
Flink
提供了一个简单
REST
机制来实现这个功能,而
Storm
提供了自己的再平衡命令。
11.7.3
 自动伸缩应用程序
自动伸缩是根据特定指标自动伸缩应用程序的过程。这些指标可能包括处理延迟、消费
者滞后度、内存使用率和
CPU
使用率等
。一些框架有自建的自动伸缩选项,比如谷歌的
Dataflow
擎、
Heron
的健康管理器和
Spark Streaming
的动态分配功能。其他框架可能
会要求你收集自己的性能和资源利用率指标,并将它们关联到框架的伸缩机制中,比如
14.10
节讨论的滞后度监控工具。
11.8
 从故障中恢复
重量级集群被设计为对长期运行的作业所不可避免的故障具有高度的容忍度。主节点、工
作者节点和
ZooKeeper
节点
(如果适用的话)的故障都可得到减轻,以允许应用程序在几
乎不中断的情况下继续运行。这些容错功能内置于集群框架中,但在部署集群时可能需要
额外的配置。
如果工作者节点发生故障,那么在该节点上正在运行的任务就会被转移到其他可用的节点
上。任何所需的内部状态都会从最近的检查点与分区分配一起重新加载。主节点故障对于
已经执行的应用程序应该是透明的,但是根据集群的配置,在主节点中断期间,你可能无
法部署新作业。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

监控运维实践:原则与策略

监控运维实践:原则与策略

Mike Julian
Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino
Web容量规划之美

Web容量规划之美

Arun Kejariwal, John Allspaw

Publisher Resources

ISBN: 9787115571106