容错和 Kubernetes StatefulSet
Fault Tolerance and Kubernetes StatefulSet
据我了解,大多数数据库都支持使用可以在领导者不可用时接管领导者的副本。
我想知道在使用 StatefulSet 时在 Kubernetes 环境中拥有这些副本的必要性。一旦 pod 变得无响应,Kubernetes 会重新启动它,对吧?并且 PVC 将确保数据不会丢失。
领导选举是否比提出新申请更快?
或者副本的唯一优势是为读取查询提供负载平衡?
As I understand it, most databases enable the use of replicas that can take over from a leader in case the leader is unavailable.
I'm wondering the necessity of having these replicas in a Kubernetes environment, when using say a StatefulSet.
已经从以前的单节点数据库转移到分布式数据库。分布式数据库通常 运行 在集群中使用 3 或 5 个副本/实例。这样做的主要目的是高可用性和容错能力,例如节点或磁盘故障。如果数据库在 Kubernetes 上是 运行,这也是一样的。
the PVC will make sure the data isn't lost.
PVC 的目的是将应用程序配置与存储系统的选择分离。这允许你,例如可以在 Google Cloud、AWS 和 Minikube 上部署相同的应用程序而无需任何不同的配置,尽管您将使用不同的存储系统。这不会改变存储系统的工作方式。
Is it that leader election is a faster process than bringing up a new application?
很多不同的事情都可能失败,节点、存储系统或网络可以被分区,这样你就无法到达某个节点。
领导者选举只是集群设置中这些问题的一部分缓解措施,您还需要以一致的方式复制所有数据。 Raft consensus algorithm 是现代分布式数据库中对此的常见解决方案。
Or is it that the only advantage of the replicas is to provide load balancing for read queries?
这在分布式数据库中可能是一个优势,是的。但根据我的经验,这很少是使用它们的主要原因。
据我了解,大多数数据库都支持使用可以在领导者不可用时接管领导者的副本。
我想知道在使用 StatefulSet 时在 Kubernetes 环境中拥有这些副本的必要性。一旦 pod 变得无响应,Kubernetes 会重新启动它,对吧?并且 PVC 将确保数据不会丢失。
领导选举是否比提出新申请更快?
或者副本的唯一优势是为读取查询提供负载平衡?
As I understand it, most databases enable the use of replicas that can take over from a leader in case the leader is unavailable.
I'm wondering the necessity of having these replicas in a Kubernetes environment, when using say a StatefulSet.
已经从以前的单节点数据库转移到分布式数据库。分布式数据库通常 运行 在集群中使用 3 或 5 个副本/实例。这样做的主要目的是高可用性和容错能力,例如节点或磁盘故障。如果数据库在 Kubernetes 上是 运行,这也是一样的。
the PVC will make sure the data isn't lost.
PVC 的目的是将应用程序配置与存储系统的选择分离。这允许你,例如可以在 Google Cloud、AWS 和 Minikube 上部署相同的应用程序而无需任何不同的配置,尽管您将使用不同的存储系统。这不会改变存储系统的工作方式。
Is it that leader election is a faster process than bringing up a new application?
很多不同的事情都可能失败,节点、存储系统或网络可以被分区,这样你就无法到达某个节点。
领导者选举只是集群设置中这些问题的一部分缓解措施,您还需要以一致的方式复制所有数据。 Raft consensus algorithm 是现代分布式数据库中对此的常见解决方案。
Or is it that the only advantage of the replicas is to provide load balancing for read queries?
这在分布式数据库中可能是一个优势,是的。但根据我的经验,这很少是使用它们的主要原因。