Skip to content

扩容节点后数据库消失 #842

Open
@liarby

Description

@liarby

Kubernetes version: v1.26.0(KubeSphere:v3.4.1)
Helm version: v3.12.0
RadonDB Operator version: 3.0.0
RadonDB MySQL version: 8.0.25

数据库集群节点从1节点扩到3节点后,创建的数据库消失
操作过程:
1、检查1节点集群状态
image

2、创建数据库
image

3、将集群节点扩容到3个
[root@k8s-master001 ~]# kubectl get all -n mysql-cluster
NAME READY STATUS RESTARTS AGE
pod/radondb-operator-mysql-operator-846657db5-xsb6v 2/2 Running 0 45h
pod/sample-mysql-0 3/3 Running 0 87s
pod/sample-mysql-1 3/3 Running 0 3m43s
pod/sample-mysql-2 3/3 Running 0 2m40s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/mysql-operator-metrics ClusterIP 10.233.35.195 8443/TCP 45h
service/radondb-mysql-webhook ClusterIP 10.233.60.113 443/TCP 45h
service/sample-follower ClusterIP 10.233.24.81 3306/TCP,8082/TCP 3m44s
service/sample-leader ClusterIP 10.233.51.178 3306/TCP,8082/TCP 44h
service/sample-mysql ClusterIP None 3306/TCP,8082/TCP 44h

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/radondb-operator-mysql-operator 1/1 1 1 45h

NAME DESIRED CURRENT READY AGE
replicaset.apps/radondb-operator-mysql-operator-846657db5 1 1 1 45h

NAME READY AGE
statefulset.apps/sample-mysql 3/3 44h
[root@k8s-master001 ~]# kubectl describe pod/sample-mysql-0 -n mysql-cluster | grep role
role=FOLLOWER
[root@k8s-master001 ~]# kubectl describe pod/sample-mysql-1 -n mysql-cluster | grep role
role=LEADER
[root@k8s-master001 ~]# kubectl describe pod/sample-mysql-2 -n mysql-cluster | grep role
role=FOLLOWER
[root@k8s-master001 ~]# kubectl describe pod/sample-mysql-2 -n mysql-cluster | grep healthy=
healthy=yes
[root@k8s-master001 ~]# kubectl describe pod/sample-mysql-1 -n mysql-cluster | grep healthy=
healthy=yes
[root@k8s-master001 ~]# kubectl describe pod/sample-mysql-0 -n mysql-cluster | grep healthy=
healthy=yes
扩容后

4、查看数据库
image

可以看到数据库hx_db已经没有了

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions