osism / issues

This repository is used for bug reports that are cross-project or not bound to a specific repository (or to an unknown repository).
https://www.osism.tech
1 stars 1 forks source link

Document how to remove a MariaDB Galera cluster node #1048

Open berendt opened 3 months ago

berendt commented 3 months ago

Probably this way. Not yet fully tested.

BEFORE STOP:

MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'wsrep_incoming_addresses';
+--------------------------+----------------------------------------------------------+
| Variable_name            | Value                                                    |
+--------------------------+----------------------------------------------------------+
| wsrep_incoming_addresses | 192.168.16.10:3306,192.168.16.11:3306,192.168.16.12:3306 |
+--------------------------+----------------------------------------------------------+
1 row in set (0.002 sec)

MariaDB [(none)]> SHOW variables LIKE 'wsrep_cluster_address';
+-----------------------+------------------------------------------------------------------+
| Variable_name         | Value                                                            |
+-----------------------+------------------------------------------------------------------+
| wsrep_cluster_address | gcomm://192.168.16.10:4567,192.168.16.11:4567,192.168.16.12:4567 |
+-----------------------+------------------------------------------------------------------+
1 row in set (0.002 sec)

AFTER STOP:

MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'wsrep_incoming_addresses';
+--------------------------+---------------------------------------+
| Variable_name            | Value                                 |
+--------------------------+---------------------------------------+
| wsrep_incoming_addresses | 192.168.16.11:3306,192.168.16.10:3306 |
+--------------------------+---------------------------------------+
1 row in set (0.001 sec)

MariaDB [(none)]> SHOW variables LIKE 'wsrep_cluster_address';
+-----------------------+------------------------------------------------------------------+
| Variable_name         | Value                                                            |
+-----------------------+------------------------------------------------------------------+
| wsrep_cluster_address | gcomm://192.168.16.10:4567,192.168.16.11:4567,192.168.16.12:4567 |
+-----------------------+------------------------------------------------------------------+
1 row in set (0.001 sec)

REMOVE NODE FROM RUNNING CONFIG (run this on all remaining nodes):

MariaDB [(none)]> SET GLOBAL wsrep_cluster_address = "gcomm://192.168.16.10:4567,192.168.16.11:4567";
Query OK, 0 rows affected (2.032 sec)

Also modify wsrep_cluster_address in the /etc/kolla/mariadb/galera.cnf file.

Belgeron commented 2 months ago

Tested it with a 3 Node and 5 Node Debian MariaDB 11.4.2 Galera Cluster wsrep_26.22, but should als work with older versions as documentation stated.

Works like posted above, just SET wsrep_cluster_address in MariaDB is not nessesary as this will be updated automatillcy as soon as one DB Node goes down. When it comes up again the address will be added again if it's present at the wsrep_cluster_address galera.cnf File.

If the node finally is out, just remove the ip from galera.cnf that's it, a restart of the DB is not necessary.