k8s MariaDb Galera Cluster

Restore huge db to Galera/Mariadb - using single node

Restart - after orderly shutdown

Restart - after hard crash of all nodes

HAPROXY liveness script for MariaDB Galera

MySQL (MariaDB) ram tuning

Error messages Mariadb/Galera

  1. "[Warning] WSREP: no nodes coming from prim view, prim not possible"
    • or "[ERROR] WSREP: It may not be safe to bootstrap the cluster from this node. It was not the last one to leave the cluster ..."
    • Which means that no cluster primary node exists and it can't figure out if it should become primary.
    • recovery:
      • we could try starting the DB’s in parallel, or putting each to sleep and making the HealthCheck pass, while we manually follow the recovery steps

      • Boot strapping / recovery

        1. Delay restarts
          • update on the StatefulSets parameter readinessProbe under initialDelaySeconds from the default 30 to 300 (which is 5 minutes) to allow sufficient time to edit the impacted file

        2. Find latest db

          mysqld --wsrep-recover
        3. select the pod to boot first
          • Update grstate.dat

            cat /bitnami/mariadb/data/grastate.dat
            # uuid: 2a651c5d-139e-11ee-8733-0eab9be77c14
            # seqno: -1
            # safe_to_bootstrap: 0
            cd /bitnami/mariadb/data
            sed -i  “s/safe_to_bootstrap: 0/safe_to_bootstrap: 1/“ grstate.dat
            # Now delete / recreate pod to bootstrap

k8s/MariaDbGaleraCluster (last edited 2024-01-30 02:27:20 by PieterSmit)