Blog

1. 集群部署方式

采用 MySQL Operator 管理 InnoDB Cluster,通过 InnoDBCluster 自定义资源声明集群拓扑,由 Operator 自动完成初始化、成员加入、故障检测与转移。

2. 使用的 MySQL 功能

《kubernetes_MySQL_Operator高可用》文章正文配图 — STARBUCKET BLOG

3. 集群配置(YAML)

apiVersion: mysql.oracle.com/v2
kind: InnoDBCluster
metadata:
  name: mysql-cluster
  namespace: dev
spec:
  secretName: mysql-root-secret        # root 凭证 Secret
  tlsUseSelfSigned: true               # 内部通信使用自签名 TLS
  instances: 3                         # 3 节点,容忍 1 节点故障
  version: "8.4.0"                     # MySQL 8.4.0,默认启用故障转移一致性

  router:
    instances: 1                       # Router 副本数(生产建议 2)

  datadirVolumeClaimTemplate:          # 每个实例独立 PVC
    accessModes: ["ReadWriteOnce"]
    storageClassName: ceph-rbd         # Ceph RBD 三副本存储
    resources:
      requests:
        storage: 20Gi

  podSpec:
    resources:
      requests:
        cpu: 200m
        memory: 512Mi
      limits:
        cpu: "1"
        memory: 2Gi

Comments & discussion

The first comment in each thread opens a topic. Signed-in readers can keep the conversation going under that topic.

No comments yet. Sign in to start a topic.

Start a new topic

Sign in to start a topic or join the discussion.