-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
35 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# 4.7 小结 | ||
|
||
作为分布式系统的入口,负载均衡器的市场竞争激烈,技术创新层出不穷。各类负载均衡器技术无法逐一解释,但从处理请求的网络层次划分,所有的负载均衡器可分为两类:四层负载均衡和七层负载均衡。 | ||
作为分布式系统的入口,负载均衡领域竞争激烈,技术创新层出不穷。各类负载均衡器技术无法逐一解释,但从处理请求的网络层次划分,所有的负载均衡器可分为两类:四层负载均衡和七层负载均衡。 | ||
|
||
四层负载均衡器处理传输层连接,功能相对简单,主要依赖 IP 地址和端口信息进行流量分发。随着技术的不断演进,传统负载均衡设备(如 F5)逐渐被通用服务器之上,基于 IPVS、DPDK、fd.io 等框架的专用软件方案取代。例如,一台普通物理主机,在基于 DPDK 开发的流量转发或数据包处理场景下,能轻松达突破百万到数千万的 PPS(Packets Per Second,每秒处理的数据包数量)指标。 | ||
四层负载均衡器处理传输层连接,功能相对简单,主要依赖 IP 地址和端口信息进行流量分发。随着技术的不断演进,传统负载均衡设备(如 F5)逐渐被通用服务器加上专用软件(如 IPVS、DPDK、fd.io)的方案取代。例如,一台普通物理主机,基于 DPDK 开发的流量转发或数据包处理场景下,能轻松达突破百万到数千万的 PPS(Packets Per Second,每秒处理的数据包数量)指标。 | ||
|
||
七层负载均衡器处理应用层流量,职责更广,功能更强。如处理 HTTP 请求、SSL 卸载、URL 路由、Cookie 路由等。这几年,源于微服务架构的快速发展,该领域十分活跃。像传统代理软件(NGINX、HAProxy),也逐渐被更适应动态微服务架构后来者(Envoy、Traefik...)替代。 | ||
七层负载均衡器处理应用层流量,职责更广、功能丰富。如处理 HTTP 请求、SSL 卸载、URL 路由、Cookie 路由等。这几年,源于微服务架构的快速发展,七层负载均衡领域十分活跃,像传统代理软件(NGINX、HAProxy),逐渐被更适应动态微服务架构后来者(Envoy、Traefik...)替代。 | ||
|
||
总体而言,随着技术架构逐步向云厂商主导的 IaaS、CaaS 和 FaaS 模式演进,未来工程师将很少需要关注物理网络的工作原理。隐藏在通用软件方案中的各类网络技术,将逐渐演变为“黑科技”。 | ||
总体而言,随着技术架构逐步向云厂商主导的 IaaS、CaaS 和 FaaS 模式演进,未来工程师将很少需要关注物理网络的工作原理。隐藏在通用软件方案中的各类网络技术,正逐渐演变为“黑科技”。 | ||
|
||
参考文档: | ||
- 《现代网络负载均衡与代理导论》,https://blog.envoyproxy.io/introduction-to-modern-network-load-balancing-and-proxying-a57f6ff80236 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
# 6.5 小结 | ||
|
||
做架构设计最难的是“如何支撑海量请求”,解决这一挑战的核心在于分布式系统。分布式系统的关键问题是:如何在节点可能故障的情况下,确保对某个操作达成一致。 | ||
做架构设计最难的是“如何支撑海量请求”,解决这一挑战的核心在于分布式系统。分布式系统的关键问题是:**在不确定的环境下,仍然能够协商出一致的决策,对外呈现出一致的运行结果**。 | ||
|
||
尽管 Paxos 是几十年前提出的算法,但它开创了分布式共识的研究。Paxos 通过多数派投票机制和两阶段协议(Prepare 和 Accept)明确了对单个值达成共识。解决了单值一致性问题后,执行多次 Paxos 算法即可实现一系列值的共识,这便是 Multi-Paxos 的核心思想。基于 Multi-Paxos 思想,将整个共识过程分解为几个子问题:领导者选举、日志复制和安全性,这就是易理解、易论证、易实现的 Raft 算法。 | ||
尽管 Paxos 是几十年前提出的算法,但它开创了分布式共识的研究。Paxos 通过多数派投票机制和两阶段协议(Prepare 和 Accept)明确了对单个值达成共识。解决了单值一致性问题后,执行多次 Paxos 算法即可实现一系列值的共识,这便是 Multi-Paxos 的核心思想。基于 Multi-Paxos 思想,将系统共识分解为几个子问题:领导者选举、日志复制和安全性,这就是易理解、易论证、易实现的 Raft 算法。 | ||
|
||
|
||
在充满不确定性的世界中建立秩序,保证了系统的可靠性和一致性,这才有了区块链(以太坊、比特币)、分布式系统、云计算等大放异彩的故事。 | ||
|
||
|
||
|
||
参考文档: | ||
- https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying | ||
- raft 动画,https://raft.github.io/raftscope/index.html | ||
- 《In Search of an Understandable Consensus Algorithm》,https://raft.github.io/raft.pdf | ||
- 《Raft 分布式系统一致性协议探讨》,https://zhuanlan.zhihu.com/p/510220698 | ||
- 《Implementing Replicated Logs | ||
with Paxos》,https://ongardie.net/static/raft/userstudy/paxos.pdf | ||
毫不夸张地说,正是 Lamport 等科学家们的开创性工作(在混沌中建立秩序),这才有了区块链(以太坊、比特币)、分布式系统、云计算等大放异彩的故事。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.