本文介绍 Kubernetes 支持数据库等有状态应用的常见解决方案:StatefulSet。
在构建机器学习向量管理层时,我们面临的一个重要问题:如何持久化数据以避免数据丢失?
在阅读了许多数据库企业发布的博客后,我们认为 StatefulSet[1] 是实现这个目标的可行方法。
我们研究了不同的数据库,包括 Cockroach、MySQL、MongoDB、Cassandra、PostgreSQL、Dgraph 和 Redis。我们还研究了 Kafka 和 Zookeeper,因为它们都需要持久化状态。我们选择这些数据库是基于两方面:
下面列出了一些关于如何使用 StatefulSet 在 Kubernetes 中部署不同数据库或有状态应用程序的文章。
Kubernetes 有两种方法管理状态:DaemonSet 和 StatefulSet,但是 Cockroach 强烈建议使用 StatefulSet。
这篇文章介绍了使用 Kubernetes StatefulSet 部署 MySQL 的端到端流程。
基于上述文章,我们将开始使用 StatefulSet,看看它是否能够满足我们的应用场景。
原文链接:https://medium.com/@junxie2/kubernetes-statefulset-for-db-applications-7fd186c6ccb9
1.StatefulSet: https://kubernetes.io/zh-cn/docs/tutorials/stateful-application/basic-stateful-set/
2.3 ways to master stateful apps in Kubernetes:https://www.cockroachlabs.com/blog/kubernetes-orchestrate-sql-with-cockroachdb/
3.How to Run CockroachDB on Kubernetes:https://www.cockroachlabs.com/blog/running-cockroachdb-on-kubernetes/
4.Deploy a Local Cluster with Kubernetes:https://www.cockroachlabs.com/docs/stable/orchestrate-a-local-cluster-with-kubernetes.html
5.Run a Replicated Stateful Application:https://kubernetes.io/docs/tasks/run-application/run-replicated-stateful-application/
6.Kubernetes StatefulSet — Example & Best Practices:https://loft.sh/blog/kubernetes-statefulset-examples-and-best-practices/
7.Running MongoDB on Kubernetes with StatefulSets:https://kubernetes.io/blog/2017/01/running-mongodb-on-kubernetes-with-statefulsets/
8.How to Run MongoDB on Kubernetes:https://kubernetes.io/blog/2017/01/running-mongodb-on-kubernetes-with-statefulsets/
9.Deploying Cassandra with a StatefulSet:https://kubernetes.io/docs/tutorials/stateful-application/cassandra/
10.Deploying PostgreSQL as a StatefulSet in Kubernetes:https://www.bmc.com/blogs/kubernetes-postgresql/
11.Dgraph:https://dgraph.io/docs/deploy/kubernetes/
12.Deploying Redis Cluster on Kubernetes:https://www.containiq.com/post/deploy-redis-cluster-on-kubernetes
13.Set-up Kafka Cluster Using Kubernetes StatefulSet:https://medium.com/@knoldus/set-up-kafka-cluster-using-kubernetes-statefulset-30d73d25864b
14.Running Zookeeper, A Distributed System Coordinator:https://kubernetes.io/docs/tutorials/stateful-application/zookeeper/