Saturday, May 20, 2023

.::: Remove a node to existing MariaDB Galera Cluster :::.

 A. Temporary remove
1. check status existing galera status before remove. for 3 node
show status like 'wsrep_incoming_addresses';
show status like 'wsrep_cluster_weight';
show status like 'wsrep_cluster_size';
show status like 'wsrep_connected';

 




2. stop service node3 or shutdown machine

3. check status existing galera status after node3 shutdown in node1 & node2
show status like 'wsrep_incoming_addresses';
show status like 'wsrep_cluster_weight';
show status like 'wsrep_cluster_size';
show status like 'wsrep_connected';

 



B. Permanen Remove
1. check status existing galera status before remove. for 3 node
show status like 'wsrep_incoming_addresses';
show status like 'wsrep_cluster_weight';
show status like 'wsrep_cluster_size';
show status like 'wsrep_connected';

 



2. stop service node3 or shutdown machine or remove galera in node3 & restart mariadb

3. edit /etc/my.cnf.d/server.cnf and remove node3 <10.10.10.13>


wsrep_cluster_address="gcomm://10.10.10.11,10.10.10.12,10.10.10.13"

change to

wsrep_cluster_address="gcomm://10.10.10.11,10.10.10.12"


4. check galera configuration again
[root@teguhth01 ~]# cat /etc/my.cnf.d/server.cnf | grep wsrep_cluster_address
#wsrep_cluster_address=
wsrep_cluster_address="gcomm://10.10.10.11,10.10.10.12"

[root@teguhth02 ~]# cat /etc/my.cnf.d/server.cnf | grep wsrep_cluster_address
#wsrep_cluster_address=
wsrep_cluster_address="gcomm://10.10.10.11,10.10.10.12"


5. restart mariadb
[root@teguhth01 ~]# systemctl restart mariadb

[root@teguhth02 ~]# systemctl restart mariadb


6. check status existing galera status after node3 shutdown in node1 & node2
show status like 'wsrep_incoming_addresses';
show status like 'wsrep_cluster_weight';
show status like 'wsrep_cluster_size';
show status like 'wsrep_connected';

show status like 'wsrep_incoming_addresses';
show status like 'wsrep_cluster_weight';
show status like 'wsrep_cluster_size';
select @@hostname, @@version;


 

No comments:

Post a Comment

Popular Posts