简体   繁体   English

为什么默认的 Google Kubernetes Engine 集群中有 3 个节点?

[英]Why are there 3 nodes in a default Google Kubernetes Engine cluster?

A default Google Kubernetes Engine (GKE) cluster默认的 Google Kubernetes Engine (GKE) 集群

gcloud container clusters create [CLUSTER_NAME] \
--zone [COMPUTE_ZONE]

starts with 3 nodes.从 3 个节点开始。 What's the idea behind that?这背后的想法是什么? Shouldn't 2 nodes in the same zone be sufficient for high availability?同一区域中的 2 个节点是否足以实现高可用性?

Kubernetes uses etcd for state. Kubernetes 使用etcd作为状态。 Etcd uses Raft for consensus to achieve high availability properties. Etcd 使用Raft进行共识以实现高可用特性。

When using a consensus protocol like Raft, you need majority in voting.当使用像 Raft 这样的共识协议时,你需要多数投票。 Using 3 nodes you need 2 of 3 nodes to respond for availability.使用 3 个节点,您需要 3 个节点中的 2 个来响应可用性。 Using 2 nodes, you can not get majority with only 1 of 2 nodes, so you need both 2 nodes to be available.使用 2 个节点,您无法仅通过 2 个节点中的 1 个获得多数,因此您需要两个节点都可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM