mysql-operator
mysql-operator copied to clipboard
cannot recreate cluster without data lose
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
MySQL Operator Version: 0.3.0
Environment:
-
Kubernetes version (use
kubectl version
): v1.11.6-gke.2 - Cloud provider or hardware configuration: GKE
- OS (e.g. from /etc/os-release): -
-
Kernel (e.g.
uname -a
): - - Others:
What happened?
I have a cluster with data. for example, I need to adjust tolerations in CR. I delete CR config and create CR config with the same name. data is preserved on PVC. new cluster cannot be started from mysql directory with data.
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
my-mmm-0 1/2 Running 0 6m
$ kubectl logs my-mmm-0 -c mysql
2019-01-22T10:45:45.463029Z 0 [Note] [MY-011323] [Server] Plugin mysqlx reported: 'X Plugin listens on TCP (bind-address:'::', port:33060)'
2019-01-22T10:45:45.463087Z 0 [Note] [MY-011323] [Server] Plugin mysqlx reported: 'X Plugin listens on UNIX socket (/var/run/mysqld/mysqlx.sock)'
2019-01-22T10:45:45.463188Z 0 [Note] [MY-011328] [Server] Plugin mysqlx reported: 'Server starts handling incoming connections'
2019-01-22T10:45:52.432075Z 10 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
2019-01-22T10:46:02.464177Z 11 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
2019-01-22T10:46:12.496289Z 12 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
2019-01-22T10:46:22.527586Z 13 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
2019-01-22T10:46:32.560632Z 14 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
2019-01-22T10:46:42.598818Z 15 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
2019-01-22T10:46:52.634156Z 16 [Note] [MY-010926] [Server] Access denied for user 'root'@'::1' (using password: YES)
What you expected to happen?
cluster started without issues.
How to reproduce it (as minimally and precisely as possible)?
kubectl get mysqlclusters/my-mmm -o yaml > /tmp/backup_cr.yaml
kubectl delete mysqlclusters/my-mmm
kubectl apply -f /tmp/backup_cr.yaml
Anything else we need to know?
no
Hi @delgod, would you mind trying with a pre-created root password secret referenced in the Cluster CR? I believe the issue here is that we're auto-generating a fresh password that does not match the previous password stored in the data directory.
If the above is the case I'm not sure we can do anything about this without removing the password generation functionality (which I'm not necessarily completely opposed to doing but would require thought).
Ran into same issue, prydie's solution worked for me.
- Create secret kubectl create secret generic my-password-secret --from-literal=password=supersecretpassword
- Reference it in "Cluster" CR ... kind: Cluster spec: members: 1 rootPasswordSecret: my-password-secret ...