Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liarby opened this issue Mar 29, 2024 · 2 comments
Open

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

liarby opened this issue Mar 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@liarby
Copy link

liarby commented Mar 29, 2024

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已经没有了

@liarby liarby added the bug Something isn't working label Mar 29, 2024
@guoai2015
Copy link

这个东西不稳定,我们测试库3节点,扩到5节点,新建的两个节点主从同步一直报错,然后自动重新选主,把新建的选成主了,又把旧的主节点重启变成从节点了。这东西只适合初期搭建的时候用,后期扩容用不了

@liarby
Copy link
Author

liarby commented Nov 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants