oracle / mysql-operator

Create, operate and scale self-healing MySQL clusters in Kubernetes
870 stars 235 forks source link

MySQL failed to initialize after PV (GlusterFS) #252

Open BostjanBozic opened 5 years ago

BostjanBozic commented 5 years ago

Versions

MySQL Operator Version: 0.3.0

Environment:

What happened?

MySQL database does not start. I checked issue #181 , but it looks like dirfferent issue. I created MySQL cluster without any PVC and it ran without issues. After that I tried to create cluster with PV. I have created Persistent Volume with Gluster plugin, using following YAML:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: gluster-test-mysql
  namespace: mysql
  labels:
    app: test-mysql-volume
spec:
  capacity:
    storage: 50Gi
  accessModes:
    - ReadWriteMany
  glusterfs:
    path: gordo
    endpoints: glusterfs-cluster
    readOnly: false

For setting up cluster, I created simple 1 node cluster, using following YAML:

apiVersion: mysql.oracle.com/v1alpha1
kind: Cluster
metadata:
  name: mysql-test
  namespace: mysql
spec:
  members: 1
  rootPasswordSecret:
    name: test-root-user
  volumeClaimTemplate:
    metadata:
      name: test-data
    spec:
      accessModes:
        - ReadWriteMany
      selector:
        matchLabels:
          app: test-mysql-volume
      resources:
        requests:
          storage: 50Gi

What I see is that both PersistentVolume and PersistentVolumeClaim are successfully created and bound, but MySQL pod is crashing.

NAME                   STATUS   VOLUME              CAPACITY   ACCESS MODES   STORAGECLASS   AGE
test-data-mysql-epg-0   Bound    gluster-epg-mysql   50Gi       RWX                           24h

NAME                 CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                           STORAGECLASS   REASON   AGE
gluster-epg-mysql    50Gi       RWX            Retain           Bound    mysql/epg-data-mysql-epg-0                                              24h

MySQL agent container within pod is running ok, waiting for database to be set up. MySQL container itself is failing with database failing to start:

[ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.

What you expected to happen?

Cluster to start normally without any issues while using GlusterFS for PV.

How to reproduce it (as minimally and precisely as possible)?

Create GlusterFS PV and run MySQL cluster with mysql-operator.

Anything else we need to know?

I am not sure if this is the issue or I am in the end doing something wrong myself, in that case I apologise for causing a stir.

linqingping commented 5 years ago

how to slove it

sufiaalmas commented 5 years ago

I am facing the same issue. Did you find the solution?

jonesmith518 commented 5 years ago

Mabe MySQL-operator is using the wrong version of agent and operator docker img, which is making me mad and troubled about 3 days