Skip to Content
Dapr学习手册
book

Dapr学习手册

by Haishi Bai, Yaron Schneider
November 2021
Beginner to intermediate
239 pages
4h 15m
Chinese
China Electric Power Press Ltd.
Content preview from Dapr学习手册
状态
91
用的服务器。相反,它必须记住哪些请求属于哪个副本集。当有状态的服务
被扩展出来时,它通常被分割成多个分区。一个副本集被限制在一个单一的
分区中。当系统需要为副本集召集新的服务器时,它只在同一分区的服务器
中搜索。这使得管理复制集合的效率更高,尤其是在大集群中。
我们可以选择多种分区策略,包括静态和动态。按区域
ID
进行分区是静态分
区的例子,按一致性哈希进行分区是动态分区的例子。动态分区可以随着可
用服务器数量的变化而调整。当有新的服务器加入集群时,分区将被重新分配,
以利用额外的容量;当集群缩小时,分区将被压缩到剩余的资源中。
当使用分区时,分区
ID
可被放置在请求路径以协助进行路由选择。例如,到
被分区的
foo
服务的请求路径可能是:
https://<host>/<partition>/foo
这种路由方案要求负载均衡器支持按分区路由。如果负载平衡器不支持按分
区路由,可能会出现额外的跳转。例如,如果一个准备发往
A
分区的请求被
路由到
B
分区的服务器,那么该服务器需要将请求转发到
A
分区服务器。
分区上的工作负载可能会变得不平衡。一些繁忙的分区被请求淹没,而其他
闲置的分区却保持休眠状态,浪费计算资源。某些高级调度器支持资源平衡,
它可以动态地重新安排服务器节点上的分区,使服务器的负载均匀。不过,
移动分区的成本很高,因为它必须携带其状态数据。所以调度器必须在减少
移动次数和保持各服务器的资源消耗平衡之间寻找平衡点。
关键是,扩展有状态服务也非常困难。
2.1.4
将有状态服务转换为无状态服务
将有状态服务转换为无状态服务很简单 ...
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

流畅的Python(第2版)

流畅的Python(第2版)

Luciano Ramalho
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Python预测分析实战

Python预测分析实战

Posts & Telecom Press, Alvaro Fuentes
机器学习开发者指南

机器学习开发者指南

Posts & Telecom Press, Rodolfo Bonnin

Publisher Resources

ISBN: 9787519859367