码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 翻译|使用 StatefulSet 运行数据库应用


    本文介绍 Kubernetes 支持数据库等有状态应用的常见解决方案:StatefulSet。

    在构建机器学习向量管理层时,我们面临的一个重要问题:如何持久化数据以避免数据丢失?

    在阅读了许多数据库企业发布的博客后,我们认为 StatefulSet[1] 是实现这个目标的可行方法。

    我们研究了不同的数据库,包括 Cockroach、MySQL、MongoDB、Cassandra、PostgreSQL、Dgraph 和 Redis。我们还研究了 Kafka 和 Zookeeper,因为它们都需要持久化状态。我们选择这些数据库是基于两方面:

    • 它们是业界广泛使用的数据库解决方案,并可以部署在 Kubernetes 上。其中一些是云原生数据库,如 Cockroach。
    • 这些有状态应用是不同类型的,比如 MySQL 是关系型数据库,MongoDB 是非关系型数据库。研究不同类型的数据库让我们对使用 StatefulSet 方案更加自信。

    下面列出了一些关于如何使用 StatefulSet 在 Kubernetes 中部署不同数据库或有状态应用程序的文章。

    Cockroach

    • 3 ways to master stateful apps in Kubernetes[2],

    Kubernetes 有两种方法管理状态:DaemonSet 和 StatefulSet,但是 Cockroach 强烈建议使用 StatefulSet。

    • How to Run CockroachDB on Kubernetes[3]Deploy a Local Cluster with Kubernetes[4]

    MySQL

    • Run a Replicated Stateful Application[5]
    • Kubernetes StatefulSet — Example & Best Practices[6]

    这篇文章介绍了使用 Kubernetes StatefulSet 部署 MySQL 的端到端流程。

    MongoDB

    • Running MongoDB on Kubernetes with StatefulSets[7]
    • How to Run MongoDB on Kubernetes[8]

    Cassandra

    • Deploying Cassandra with a StatefulSet[9]

    PostgreSQL 

    • Deploying PostgreSQL as a StatefulSet in Kubernetes[10]

    Dgraph[11]

    Redis

    • Deploying Redis Cluster on Kubernetes[12]

    Kafka

    • Set-up Kafka Cluster Using Kubernetes StatefulSet[13]

    Zookeeper

    • Running Zookeeper, A Distributed System Coordinator[14]

    基于上述文章,我们将开始使用 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/

  • 相关阅读:
    Debezium系列之:Debezium采集Mysql数据库,数据库时间字段值的变化
    JHipster数据权限使用
    餐饮外卖配送小程序商城的作用是什么?
    LM2904DT运算放大器中文资料规格书PDF数据手册引脚图参数图片功能概述
    跳表C语言
    [论文笔记] Security Foundations for Application-Based Covert Communication Channels
    ECharts(1)
    C++ 最长公共前缀
    51单片机项目(13)——基于51单片机的智能台灯protues仿真
    软考 -- 计算机学习(3)
  • 原文地址:https://blog.csdn.net/RadonDB/article/details/126498702
  • 最新文章
  • 沪漂五周年了:我越来越迷茫了
    Agentic Skill Routing 实战:别再把所有 Skill 塞进 AI Agent 上下文
    MySQL-Seconds_behind_master的精度误差
    [MAF预定义ChatClient中间件-03]CachingChatClient——利用缓存省钱省时间
    AI的至暗历史:从万众期待到被政府撤资,AI的两次死亡徘徊
    Agent OS :五种驯服不确定性的范式
    PortSwigger SQL注入LAB11
    数据库即时编译JIT
    [Begin]AI Learn Data Day 0
    深度学习进阶(二十七)现代 LLM 的核心架构设计其二:SwiGLU
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号