====== MariaDB galera ====== ===== Links ===== * [[http://www.fromdual.com/making-haproxy-high-available-for-mysql-galera-cluster|Bespielsetup mit keepalived]] (failover IP) auf zwei haproxy-Instanzen (die ein frontend + backend auf die galera-nodes aufmacht) * https://computingforgeeks.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-18-04-with-haproxy/ * [[https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/|limitations]] ===== Installation ===== [[https://github.com/selfhostx/ansible/blob/main/playbooks/database/galera.yml|Bespielplaybook]] der Rolle [[https://github.com/mrlesmithjr/ansible-mariadb-galera-cluster|mrlesmithjr.mariadb_galera_cluster]]. ===== Cluster OK ===== SHOW STATUS LIKE 'wsrep%'; [[https://galeracluster.com/library/documentation/monitoring-cluster.html|Erklärung der Metriken]] show status like 'wsrep_cluster_size'; +--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | wsrep_cluster_size | 3 | +--------------------+-------+ show status like 'wsrep_cluster_status'; +----------------------+---------+ | Variable_name | Value | +----------------------+---------+ | wsrep_cluster_status | Primary | +----------------------+---------+ show status like 'wsrep_local_state_comment'; +---------------------------+--------+ | Variable_name | Value | +---------------------------+--------+ | wsrep_local_state_comment | Synced | +---------------------------+--------+ show status like 'wsrep_last_committed'; +----------------------+---------+ | Variable_name | Value | +----------------------+---------+ | wsrep_last_committed | 7560036 | +----------------------+---------+ ===== Recovery ===== https://www.symmcom.com/docs/how-tos/databases/how-to-recover-mariadb-galera-cluster-after-partial-or-full-crash interesting files: cat /var/lib/mysql/grastate.dat /etc/mysql/conf.d/galera.cnf -> wsrep_cluster_address