From ee3236c7a74c66e72aea43eb1f6288ff0afa42b5 Mon Sep 17 00:00:00 2001 From: Xargin Date: Sat, 9 Jun 2018 19:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B0=8F=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ch5-web/ch5-06-ratelimit.md | 1 + ...yout-of-web-project.md => ch5-07-layout-of-web-project.md} | 2 +- ch5-web/ch5-07-ratelimit.md | 1 - ...h5-09-interface-and-web.md => ch5-08-interface-and-web.md} | 0 ch5-web/ch5-09-gated-launch.md | 1 + ch5-web/ch5-10-dist-config.md | 1 - ...h5-11-service-discovery.md => ch5-10-service-discovery.md} | 4 ++-- ch5-web/{ch5-12-load-balance.md => ch5-11-load-balance.md} | 2 +- ch5-web/ch5-12-dist-config.md | 1 + ch5-web/ch5-13-circuit-breaker.md | 2 +- 10 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 ch5-web/ch5-06-ratelimit.md rename ch5-web/{ch5-08-layout-of-web-project.md => ch5-07-layout-of-web-project.md} (99%) delete mode 100644 ch5-web/ch5-07-ratelimit.md rename ch5-web/{ch5-09-interface-and-web.md => ch5-08-interface-and-web.md} (100%) create mode 100644 ch5-web/ch5-09-gated-launch.md delete mode 100644 ch5-web/ch5-10-dist-config.md rename ch5-web/{ch5-11-service-discovery.md => ch5-10-service-discovery.md} (99%) rename ch5-web/{ch5-12-load-balance.md => ch5-11-load-balance.md} (99%) create mode 100644 ch5-web/ch5-12-dist-config.md diff --git a/ch5-web/ch5-06-ratelimit.md b/ch5-web/ch5-06-ratelimit.md new file mode 100644 index 0000000..42b6af6 --- /dev/null +++ b/ch5-web/ch5-06-ratelimit.md @@ -0,0 +1 @@ +# 5.6. Ratelimit 服务流量限制 diff --git a/ch5-web/ch5-08-layout-of-web-project.md b/ch5-web/ch5-07-layout-of-web-project.md similarity index 99% rename from ch5-web/ch5-08-layout-of-web-project.md rename to ch5-web/ch5-07-layout-of-web-project.md index 797760e..78d3ebe 100644 --- a/ch5-web/ch5-08-layout-of-web-project.md +++ b/ch5-web/ch5-07-layout-of-web-project.md @@ -1,4 +1,4 @@ -# 5.8. layout 常见大型 web 项目分层 +# 5.7. layout 常见大型 web 项目分层 流行的 web 框架大多数是 MVC 框架,MVC 这个概念最早由 Trygve Reenskaug 在 1978 年提出,为了能够对 GUI 类型的应用进行方便扩展,将程序划分为: diff --git a/ch5-web/ch5-07-ratelimit.md b/ch5-web/ch5-07-ratelimit.md deleted file mode 100644 index 53f9f4d..0000000 --- a/ch5-web/ch5-07-ratelimit.md +++ /dev/null @@ -1 +0,0 @@ -# 5.7. Ratelimit 服务流量限制 diff --git a/ch5-web/ch5-09-interface-and-web.md b/ch5-web/ch5-08-interface-and-web.md similarity index 100% rename from ch5-web/ch5-09-interface-and-web.md rename to ch5-web/ch5-08-interface-and-web.md diff --git a/ch5-web/ch5-09-gated-launch.md b/ch5-web/ch5-09-gated-launch.md new file mode 100644 index 0000000..fa04c3d --- /dev/null +++ b/ch5-web/ch5-09-gated-launch.md @@ -0,0 +1 @@ +# 5.9. 灰度发布和 A/B test diff --git a/ch5-web/ch5-10-dist-config.md b/ch5-web/ch5-10-dist-config.md deleted file mode 100644 index d321488..0000000 --- a/ch5-web/ch5-10-dist-config.md +++ /dev/null @@ -1 +0,0 @@ -# 5.8. Dist-config 分布式配置服务 diff --git a/ch5-web/ch5-11-service-discovery.md b/ch5-web/ch5-10-service-discovery.md similarity index 99% rename from ch5-web/ch5-11-service-discovery.md rename to ch5-web/ch5-10-service-discovery.md index a34e0d9..0557886 100644 --- a/ch5-web/ch5-11-service-discovery.md +++ b/ch5-web/ch5-10-service-discovery.md @@ -1,4 +1,4 @@ -# 5.11. Service Discovery 服务发现 +# 5.10. Service Discovery 服务发现 在微服务架构中,服务之间是存在依赖的。例如在订单系统中创建订单时,需要对用户信息做快照,这时候也就意味着这个流程要依赖: 订单、用户两个系统。当前大型网站的语境下,多服务分布式共存,单个服务也可能会跑在多台物理/虚拟机上。所以即使你知道你需要依赖的是“订单服务”这个具体的服务,实际面对的仍然是多个 ip+port 组成的集群。因此你需要: 1. 通过“订单服务”这个名字找到它对应的 ip+port 列表;2. 决定把这个请求发到哪一个 ip+port 上的订单服务。 @@ -129,7 +129,7 @@ ls /platform/order-system/create-order-service-http 当前开源的服务发现系统中,使用 zk、etcd 或者 consul,无一例外地都是看中其强一致性的特性。也就是大部分人认为服务发现和分布式系统中的任务协调场景一致,是一个 CP 系统。我们来想想,如果放弃了可用性会导致什么样的结果。 -在上面提到的几个开源组件中使用的 paxos/zab/raft 协议,若因为网络分区等原因,导致集群节点数量 < n/2 时,会导致整个集群不能对外提供服务。网络分区是分布式系统中常见的错误。如果公司的服务部署在公有云、或者私有云的 docker 环境上,网络问题就更为常见了。一旦发生网络分区,就会导致类型下面这样的场景出现: +在上面提到的几个开源组件中使用的 paxos/zab/raft 协议,若因为网络分区等原因,导致集群节点数量 < n/2 时,会导致整个集群不能对外提供服务。网络分区是分布式系统中常见的错误。如果公司的服务部署在公有云、或者私有云的 docker 环境上,网络问题就更为常见了。一旦发生网络分区,就会导致类似下面这样的场景出现: TODO,网络分区示例图 diff --git a/ch5-web/ch5-12-load-balance.md b/ch5-web/ch5-11-load-balance.md similarity index 99% rename from ch5-web/ch5-12-load-balance.md rename to ch5-web/ch5-11-load-balance.md index f0d7bf0..20d198e 100644 --- a/ch5-web/ch5-12-load-balance.md +++ b/ch5-web/ch5-11-load-balance.md @@ -1,4 +1,4 @@ -# 5.12. Load-Balance 负载均衡 +# 5.11. Load-Balance 负载均衡 本节将会讨论常见的 web 后端服务之间的负载均衡手段。 diff --git a/ch5-web/ch5-12-dist-config.md b/ch5-web/ch5-12-dist-config.md new file mode 100644 index 0000000..3c6662d --- /dev/null +++ b/ch5-web/ch5-12-dist-config.md @@ -0,0 +1 @@ +# 5.12. Dist-config 分布式配置服务 diff --git a/ch5-web/ch5-13-circuit-breaker.md b/ch5-web/ch5-13-circuit-breaker.md index 1425217..427d780 100644 --- a/ch5-web/ch5-13-circuit-breaker.md +++ b/ch5-web/ch5-13-circuit-breaker.md @@ -1 +1 @@ -# 5.9. Circuit-Breaker 熔断保护 +# 5.13. Circuit-Breaker 熔断保护