Last active
September 5, 2025 04:50
-
-
Save jniltinho/b41927078b91773fabc22216d34f7040 to your computer and use it in GitHub Desktop.
Revisions
-
jniltinho revised this gist
Sep 5, 2025 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,9 +9,15 @@ apt update apt install apt-transport-https curl curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' cat <<EOF > /etc/apt/sources.list.d/mariadb.list # MariaDB 10.6 repository list deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.rackspace.com/mariadb/repo/10.6/ubuntu $(lsb_release -cs) main EOF apt update apt install -y mariadb-server-10.6 mariadb-backup ln -s /etc/apparmor.d/usr.sbin.mariadbd /etc/apparmor.d/disable/ -
jniltinho revised this gist
Sep 5, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ ## https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/ ## https://mariadb.com/kb/en/mariabackup-sst-method/ ## https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/ ## https://mariadb.org/download/?t=repo-config&d=22.04+%22jammy%22&v=10.6&r_m=rackspace apt update -
jniltinho revised this gist
Sep 5, 2025 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,6 +46,7 @@ wsrep_cluster_name="galera_cluster" wsrep_cluster_address="gcomm://node1-ip-address,node2-ip-address,node3-ip-address" # Galera Synchronization Configuration #wsrep_sst_method=mariabackup wsrep_sst_method=rsync # Galera Node Configuration @@ -71,6 +72,7 @@ wsrep_cluster_name="galera_cluster" wsrep_cluster_address="gcomm://node1-ip-address,node2-ip-address,node3-ip-address" # Galera Synchronization Configuration #wsrep_sst_method=mariabackup wsrep_sst_method=rsync # Galera Node Configuration @@ -95,6 +97,7 @@ wsrep_cluster_name="galera_cluster" wsrep_cluster_address="gcomm://node1-ip-address,node2-ip-address,node3-ip-address" # Galera Synchronization Configuration #wsrep_sst_method=mariabackup wsrep_sst_method=rsync # Galera Node Configuration -
jniltinho revised this gist
Feb 3, 2025 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,10 @@ curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup|bash -s -- --mariad apt install -y mariadb-server-10.6 mariadb-backup ln -s /etc/apparmor.d/usr.sbin.mariadbd /etc/apparmor.d/disable/ apparmor_parser -R /etc/apparmor.d/usr.sbin.mariadbd aa-status mysql_secure_installation # Enter current password for root (enter for none): -
jniltinho revised this gist
Feb 2, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ ## https://www.howtoforge.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-20-04/ ## https://www.linkedin.com/pulse/setting-up-mariadb-galera-multi-node-cluster-ubuntu-2204-sahu-azrjc ## https://computingforgeeks.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-with-haproxy/ ## https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/ ## https://mariadb.com/kb/en/mariabackup-sst-method/ ## https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/ -
jniltinho revised this gist
Feb 2, 2025 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ ## https://www.howtoforge.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-20-04/ ## https://www.linkedin.com/pulse/setting-up-mariadb-galera-multi-node-cluster-ubuntu-2204-sahu-azrjc ## https://computingforgeeks.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-with-haproxy/ ## https://mariadb.com/kb/en/mariabackup-sst-method/ ## https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/ -
jniltinho revised this gist
Feb 2, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ apt update apt install -y curl curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup|bash -s -- --mariadb-server-version="mariadb-10.6" apt install -y mariadb-server-10.6 mariadb-backup mysql_secure_installation -
jniltinho created this gist
Feb 2, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,113 @@ #!/bin/bash ## https://www.howtoforge.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-20-04/ ## https://www.linkedin.com/pulse/setting-up-mariadb-galera-multi-node-cluster-ubuntu-2204-sahu-azrjc ## https://computingforgeeks.com/how-to-setup-mariadb-galera-cluster-on-ubuntu-with-haproxy/ ## https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/ apt update apt install -y curl curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup|bash -s -- --mariadb-server-version="mariadb-10.6" apt install -y mariadb-server-10.6 mysql_secure_installation # Enter current password for root (enter for none): # Switch to unix_socket authentication [Y/n] n # Change the root password? [Y/n] Y # New password: # Re-enter new password: # Remove anonymous users? [Y/n] Y # Disallow root login remotely? [Y/n] Y # Remove test database and access to it? [Y/n] Y # Reload privilege tables now? [Y/n] Y ## On the first node, create a galera.cnf file using the following command: cat <<EOF > /etc/mysql/conf.d/galera.cnf [mysqld] binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 bind-address=0.0.0.0 # Galera Provider Configuration wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so # Galera Cluster Configuration wsrep_cluster_name="galera_cluster" wsrep_cluster_address="gcomm://node1-ip-address,node2-ip-address,node3-ip-address" # Galera Synchronization Configuration wsrep_sst_method=rsync # Galera Node Configuration wsrep_node_address="node1-ip-address" wsrep_node_name="node1" EOF ## On the second node, create a galera.cnf file using the following command: cat <<EOF > /etc/mysql/conf.d/galera.cnf [mysqld] binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 bind-address=0.0.0.0 # Galera Provider Configuration wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so # Galera Cluster Configuration wsrep_cluster_name="galera_cluster" wsrep_cluster_address="gcomm://node1-ip-address,node2-ip-address,node3-ip-address" # Galera Synchronization Configuration wsrep_sst_method=rsync # Galera Node Configuration wsrep_node_address="node2-ip-address" wsrep_node_name="node2" EOF ## On the third node, create a galera.cnf file using the following command: cat <<EOF > /etc/mysql/conf.d/galera.cnf [mysqld] binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 bind-address=0.0.0.0 # Galera Provider Configuration wsrep_on=ON wsrep_provider=/usr/lib/galera/libgalera_smm.so # Galera Cluster Configuration wsrep_cluster_name="galera_cluster" wsrep_cluster_address="gcomm://node1-ip-address,node2-ip-address,node3-ip-address" # Galera Synchronization Configuration wsrep_sst_method=rsync # Galera Node Configuration wsrep_node_address="node3-ip-address" wsrep_node_name="node3" EOF ## You will need to stop the MariaDB service on all nodes. You can run the following command to stop the MariaDB service: systemctl stop mariadb # On the first node, initialize the MariaDB Galera cluster with the following command: galera_new_cluster mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'" ## On the second node, start the MariaDB service with the following command: systemctl start mariadb mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'" ## On the third node, start the MariaDB service with the following command: systemctl start mariadb mysql -u root -p -e "SHOW STATUS LIKE 'wsrep_cluster_size'"