What is MariaDB Galera Cluster?
MariaDB Galera Cluster is a virtually synchronous, multi-primary cluster for MariaDB. It is available on Linux only.
More details about MariaDB Galera Cluster’s features can be found at the following link: Features of MariaDB Galera Cluster. For its limitations, see: MariaDB Galera Cluster - Known Limitations
MariaDB Galera Cluster in Kubernetes backed by Veritas InfoScale for Containers
Kubernetes is a complex platform that consists of many abstractions for managing applications and their data to provide advanced container orchestration services.
Veritas provides enterprise data services focused on data management and protection. These services are designed to provide an enterprise foundation to support your containerized applications like Oracle, Postgres, MySQL, MariaDB in environments like vanilla Kubernetes or RedHat OpenShift platform.
The persistent storage to the application pods like MariaDB can be provided by using the standard Container Storage Interface (CSI) interface. The CSI interface supports a variety of data protection options for resiliency, scaling, and resizing.
Benefits of Veritas InfoScale for Containers against node/disk failure of a Kubernetes worker node
If any Kubernetes worker node goes down during data insertion, data insertion operations get affected if a non-InfoScale Storage Class is used to provide storage to the MariaDB application. Manual intervention is thus needed for re-mapping the new storage from the new node where the MariaDB pod fails over. Additional wait time is needed till the new pod re-synchronizes with the other two instances.
Using an InfoScale Storage Class with Flexible Shared Storage (i.e., local storage from the worker nodes) ensures that your data insertion operations can continue to run as if there was no storage loss. It appears like a minor glitch that would get rectified in a matter of some minutes (usually the time taken for the MariaDB application pod to failover) as the storage is available across all the cluster nodes. PVC gets mapped to the failed over pod automatically, whereas the other two instances of the MariaDB continue to run unaffected.
Using an InfoScale Storage Class with Shared storage from a SAN array protects from a worker node or a disk failure with minimal pause time only until MariaDB pod fails over to a new node.
Pre-requisites for Deployment of MariaDB Galera Cluster
Following are some of the pre-requisites for deploying MariaDB Galera Cluster with Veritas InfoScale:
Deployment of MariaDB Galera Cluster by using persistent storage managed by Veritas Infoscale
The following figure provides an overview of how Veritas provides data management and protection for MariaDB Galera Cluster application and IT services running in a Kubernetes (K8s) environment.
Configuring MariaDB Galera cluster in Kubernetes by using persistent storage from Veritas InfoScale
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-infoscale-mirror-sc # Name for the Storage Class
annotations:
# Default Storage class
storageclass.kubernetes.io/is-default-class: "true"
provisioner: org.veritas.infoscale
reclaimPolicy: Delete # Reclaim Policy can be delete/retain
allowVolumeExpansion: True # Allow growing of PV
parameters:
# Veritas InfoScale Storage Class parameters
fstype: vxfs # FS type, default vxfs
layout: "mirror" # Storage layout mirror/stripe/stripe-mirror
faultTolerence: "2" # No. of mirrors
encryption: "false" # param for supporting encryption in future
mediaType: "hdd" # Media type of storage to be used hdd/ssd
helm install my-galera --set rootUser.forcePassword=true --set rootUser.password=<root-user-password> --set db.forcePassword=true --set db.user=app_database --set db.password=<user-password> --set db.name=<DB-Name> --set global.storageClass=<InfoScale-Storage-Class-Name> --set image.tag=latest --set service.type=LoadBalancer --set service.loadBalancerIP=<metallb-VIP-to-be-used-for-load-balancing> --set galera.mariabackup.forcePassword=true --set galera.mariabackup.password=<backup-password> --set persistence.size=<PV size for each MariaDB instance> bitnami/mariadb-galera
Note: Based on your Kubernetes cluster environments you may have to tweak some additional configurations to get the MariaDB Galera Cluster in a running state. To know the additional parameters, see Charts
kubectl get sts -w --namespace default -l app.kubernetes.io/instance my-galera
kubectl run my-galera-mariadb-galera-client --rm --tty -i --restart='Never' --namespace default \
--image docker.io/bitnami/mariadb-galera:latest --command \
-- mysql -h my-galera-mariadb-galera -P 3306 -uapp_database \
-p$(kubectl get secret --namespace default my-galera-mariadb-galera \
-o jsonpath="{.data.mariadb-password}" | base64 --decode) galera_mariadb
Veritas InfoScale is a proven solution for enterprise storage management providers for managing infrastructure availability. Veritas InfoScale has evolved into a premier software-defined platform for managing storage and high availability. In Containers, InfoScale can provide several benefits that are not available natively, which provide the functionality and confidence needed to use Kubernetes or OpenShift as a target environment for hosting various applications.
You can also find additional InfoScale information and resources in the InfoScale technical library.