{"id":5937,"date":"2016-05-16T23:03:25","date_gmt":"2016-05-16T15:03:25","guid":{"rendered":"http:\/\/rmohan.com\/?p=5937"},"modified":"2016-05-16T23:27:42","modified_gmt":"2016-05-16T15:27:42","slug":"mariadb-galera-cluster-on-centos-7","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5937","title":{"rendered":"MariaDB Galera Cluster on Centos 7"},"content":{"rendered":"<p>MariaDB is a branch of Mysql, it has been widely used in open source projects, such as hot openstack, therefore, in order to ensure high availability of the service,<br \/>\nwhile increasing the load capacity of the system, the cluster deployment is essential.<\/p>\n<p><strong>MariaDB Galera Cluster Introduction<\/strong><\/p>\n<p>MariaDB Galera Cluster is an open source MariaDB synchronous multi-master cluster. It supports only XtraDB \/ InnoDB storage engine<br \/>\n(although experimental support for MyISAM &#8211; see wsrep_replicate_myisam system variable).<\/p>\n<p>Using MariaDB, you may say, &#8220;MariaDB Galera Cluster&#8221; to the redundancy of the database on CENTOS 7.2<\/p>\n<p>Database redundancy (cluster), although construction was just cumbersome MariaDB Galera Cluster is very simple.<\/p>\n<p>In addition, in order to operate as all the nodes where you want to participate in the Galera Cluster master, you can do the update work of the database at any node.<\/p>\n<p>In this post, we will introduce how to build a MariaDB Galera Cluster.<\/p>\n<p>The main function:<\/p>\n<p>Replication<br \/>\nTrue multi-master, that is, all nodes can read and write database<br \/>\nAutomatic control node membership, the failed node automatically cleared<br \/>\nThe new node is added automatically copied data<br \/>\nTrue parallel copy, row-level<br \/>\nUsers can connect directly to a cluster, the use of feelings entirely consistent with MySQL<\/p>\n<p>Advantage:<\/p>\n<p>Because it is multi-master, there is no Slavelag (delayed)<br \/>\nLost affairs absence<br \/>\nBoth read and write scalability<br \/>\nSmaller clients delay<br \/>\nData is synchronized between nodes, and Master \/ Slave mode is asynchronous, binlog on different slave may be different<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_channel_failover_galera.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5940\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_channel_failover_galera.png\" alt=\"galera_channel_failover_galera\" width=\"531\" height=\"281\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_galera.png 531w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_galera-300x159.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_galera-150x79.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_galera-400x212.png 400w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_channel_failover_slave.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5941\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_channel_failover_slave.png\" alt=\"galera_channel_failover_slave\" width=\"531\" height=\"231\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_slave.png 531w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_slave-300x131.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_slave-150x65.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_channel_failover_slave-400x174.png 400w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_overview.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5942\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_overview.png\" alt=\"galera_overview\" width=\"511\" height=\"384\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_overview.png 511w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_overview-300x225.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_overview-150x113.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_overview-400x301.png 400w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_replication1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5943\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera_replication1.png\" alt=\"galera_replication1\" width=\"371\" height=\"300\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_replication1.png 371w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_replication1-300x243.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera_replication1-150x121.png 150w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera-cluster.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5944\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera-cluster.png\" alt=\"galera-cluster\" width=\"819\" height=\"613\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster.png 819w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-300x225.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-768x575.png 768w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-150x112.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-400x299.png 400w\" sizes=\"(max-width: 819px) 100vw, 819px\" \/><\/a><\/p>\n<p>Technology:<\/p>\n<p>Galera Cluster replication based Galeralibrary achieve, in order to allow communication with the MySQL library Galera, developed specifically for MySQL wsrep API.<\/p>\n<p>Galera Cluster Synchronization Plug-assurance data, maintain data consistency, can rely on a certified copy, works as follows:<\/p>\n<p>When the client sends a commit instruction, before the transaction is committed, all changes to the database will be write-set collected, and the write-set to send the contents of the record to other nodes.<\/p>\n<p>write-set the certification testing at each node, the node test results determine whether to apply write-set change data.<\/p>\n<p>If the authentication test fails, the node will discard write-set ; if the authentication test is successful, the transaction commits.<br \/>\n1 Prepare the installation environment<\/p>\n<p>Install MariaDB server cluster requires at least three (if only two words requires special configuration, please refer to the official documentation )<\/p>\n<p>Here, I list the test machine configuration:<\/p>\n<p>Work environment<\/p>\n<p>127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4<br \/>\n::1 localhost localhost.localdomain localhost6 localhost6.localdomain6<br \/>\n192.168.1.71 apache1.rmohan.com apache1<br \/>\n192.168.1.72 apache2.rmohan.com apache2<br \/>\n192.168.1.74 apache3.rmohan.com apache3<\/p>\n<p>Run the three nodes, respectively:<\/p>\n<p>systemctl stop firewalld<\/p>\n<p>You are an expert Firewalld, you do not need to be invalidated. Please open the three ports of 3306,4444,4567.<br \/>\n# systemctl stop firewalld<br \/>\n# systemctl disable firewalld<\/p>\n<p>Disable the Selinux. You do only the following command, but we recommend that you restart.<\/p>\n<p>Then \/etc\/sysconfig\/selinux the selinux set to disabled , this initialize the environment is completed.<\/p>\n<p>setenforce 0<br \/>\nsed -i &#8220;s\/^SELINUX\\=enforcing\/SELINUX\\=disabled\/g&#8221; \/etc\/selinux\/config<\/p>\n<p>yum -y install epel-release<\/p>\n<p>vi \/etc\/yum.repos.d\/mariadb.repo<br \/>\n# MariaDB 10.1 CentOS repository list &#8211; created 2016-05-16 11:29 UTC<br \/>\n# http:\/\/mariadb.org\/mariadb\/repositories\/<br \/>\n[mariadb]<br \/>\nname = MariaDB<br \/>\nbaseurl = http:\/\/yum.mariadb.org\/10.1\/centos7-amd64<br \/>\ngpgkey=https:\/\/yum.mariadb.org\/RPM-GPG-KEY-MariaDB<br \/>\ngpgcheck=1<\/p>\n<p>Installation of 2 MariaDB Galera Cluster<\/p>\n<p>Lets install some Pre-requisites and other interesting tools.<\/p>\n<p>yum install rsync nmap lsof perl-DBI nc<\/p>\n<p>yum install -y MariaDB-server MariaDB-client galera rsync MariaDB-Galera-server MariaDB-client<\/p>\n<p>3. Install MariaDB-server and start the Mariadb service<\/p>\n<p>yum install MariaDB-server MariaDB-client MariaDB-compat galera socat jemalloc<\/p>\n<p>Launch the mysql_secure_installation command to set up the username and password. At this point you can start MariaDB normally by using the mysql command and create a database<\/p>\n<p>Complete!<br \/>\n[root@apache1 ~]# ls -ltr \/usr\/lib64\/galera\/<br \/>\ntotal 32832<br \/>\n-rwxr-xr-x 1 root root 33616730 Mar 15 01:52 libgalera_smm.so<\/p>\n<p>[root@apache1 ~]# mysql_secure_installation<\/p>\n<p>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB<br \/>\nSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!<\/p>\n<p>In order to log into MariaDB to secure it, we&#8217;ll need the current<br \/>\npassword for the root user. If you&#8217;ve just installed MariaDB, and<br \/>\nyou haven&#8217;t set the root password yet, the password will be blank,<br \/>\nso you should just press enter here.<\/p>\n<p>Enter current password for root (enter for none):<br \/>\nOK, successfully used password, moving on&#8230;<\/p>\n<p>Setting the root password ensures that nobody can log into the MariaDB<br \/>\nroot user without the proper authorisation.<\/p>\n<p>Set root password? [Y\/n] y<br \/>\nNew password:<br \/>\nRe-enter new password:<br \/>\nPassword updated successfully!<br \/>\nReloading privilege tables..<br \/>\n&#8230; Success!<\/p>\n<p>By default, a MariaDB installation has an anonymous user, allowing anyone<br \/>\nto log into MariaDB without having to have a user account created for<br \/>\nthem. This is intended only for testing, and to make the installation<br \/>\ngo a bit smoother. You should remove them before moving into a<br \/>\nproduction environment.<\/p>\n<p>Remove anonymous users? [Y\/n] n<br \/>\n&#8230; skipping.<\/p>\n<p>Normally, root should only be allowed to connect from &#8216;localhost&#8217;. This<br \/>\nensures that someone cannot guess at the root password from the network.<\/p>\n<p>Disallow root login remotely? [Y\/n] n<br \/>\n&#8230; skipping.<\/p>\n<p>By default, MariaDB comes with a database named &#8216;test&#8217; that anyone can<br \/>\naccess. This is also intended only for testing, and should be removed<br \/>\nbefore moving into a production environment.<\/p>\n<p>Remove test database and access to it? [Y\/n] n<br \/>\n&#8230; skipping.<\/p>\n<p>Reloading the privilege tables will ensure that all changes made so far<br \/>\nwill take effect immediately.<\/p>\n<p>Reload privilege tables now? [Y\/n] y<br \/>\n&#8230; Success!<\/p>\n<p>Cleaning up&#8230;<\/p>\n<p>All done! If you&#8217;ve completed all of the above steps, your MariaDB<br \/>\ninstallation should now be secure.<\/p>\n<p>Thanks for using MariaDB!<\/p>\n<p>After the normal procedure to set up the first database on apache1, you can create a database and dump it, then import the database on apache2 and apache3.<\/p>\n<p>You have now 3 independant databases on 3 different servers. I would adivce you to dump the whole database with the command<\/p>\n<p>mysqldump &#8211;all-databases &gt; db.sql<\/p>\n<p>6. We will now start setting up the Galera clustering. On apache1, edit the \/etc\/my.cnf.d\/server.cnf file on apache1 and configure it as follows. The server apache1 is the being setup as the first primary cluster. So every other cluster is going to be set up in the network that is galera2 and galera3 is going to replicate itself from apache1. Add the following parameter under the [galera] option.<br \/>\nvim \/etc\/my.cnf.d\/server.cnf<\/p>\n<p>[galera]<br \/>\n# Mandatory settings<br \/>\nwsrep_on=ON<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=&#8217;gcomm:\/\/&#8217;<br \/>\nwsrep_cluster_name=&#8217;galera&#8217;<br \/>\nwsrep_node_address=&#8217;apache1&#8242;<br \/>\nwsrep_node_name=&#8217;apache1&#8242;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_slave_threads=4<br \/>\nbinlog_format=row<br \/>\ndefault_storage_engine=InnoDB<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nbind-address=0.0.0.0<br \/>\ninnodb_locks_unsafe_for_binlog=1<br \/>\n#wsrep_provider_options=&#8221;socket.ssl_key=\/etc\/pki\/galera\/galera.key; socket.ssl_cert=\/etc\/pki\/galera\/galera.crt;&#8221;<\/p>\n<p>Tip: If you do not have a way ssl certification, please put wsrep_provider_options commented.<\/p>\n<p>Copy this file to apache2, apache3, attention should wsrep_node_name and wsrep_node_address into corresponding node hostname and ip<\/p>\n<p>[root@apache1 ~]# service mysql start &#8211;wsrep_cluster_address=gcomm:\/\/<br \/>\nStarting mysql (via systemctl): [ OK ]<br \/>\n[root@apache1 ~]#<\/p>\n<p>[root@apache2 systemd]# vi \/etc\/my.cnf.d\/server.cnf<br \/>\n[root@apache2 systemd]# service mysql start &#8211;wsrep_cluster_address=gcomm:\/\/<br \/>\nStarting mysql (via systemctl): [ OK ]<br \/>\n[root@apache2 systemd]#<br \/>\n[root@apache3 ~]# vi \/etc\/my.cnf.d\/server.cnf<br \/>\n[root@apache3 ~]# service mysql start &#8211;wsrep_cluster_address=gcomm:\/\/<br \/>\nStarting mysql (via systemctl): [ OK ]<br \/>\n[root@apache3 ~]#<\/p>\n<p>May 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377978452096 [Note] InnoDB: 128 rollback segment(s) are active.<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377978452096 [Note] InnoDB: Waiting for purge to start<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377978452096 [Note] InnoDB: Percona XtraDB (http:\/\/www.percona.com) 5.6.29-76.2 started; log sequence number 1616819<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377978452096 [Note] Plugin &#8216;FEEDBACK&#8217; is disabled.<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377252136704 [Note] InnoDB: Dumping buffer pool(s) not yet started<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377978452096 [Note] Server socket created on IP: &#8216;::&#8217;.<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: 2016-05-14 18:47:34 140377978452096 [Note] \/usr\/sbin\/mysqld: ready for connections.<br \/>\nMay 14 18:47:34 apache2.rmohan.com mysqld[19048]: Version: &#8216;10.1.14-MariaDB&#8217; socket: &#8216;\/var\/lib\/mysql\/mysql.sock&#8217; port: 3306 MariaDB Server<\/p>\n<p>Create a new user to Galera Server, and set the password.<\/p>\n<p>&#8220;New User: root&#8221;,: and then to the &#8220;password test123&#8221;.<\/p>\n<p># mysql -e &#8220;grant all privileges on *.* to root@&#8217;%&#8217; identified by &#8216;test123&#8217; with grant option;&#8221;<br \/>\n# mysql -e &#8220;grant all privileges on *.* to root@localhost identified by &#8216;test123&#8242; with grant option;&#8221;<\/p>\n<p>MariaDB [(none)]&gt; grant all privileges on *.* to root@&#8217;%&#8217; identified by &#8216;test123&#8217; with grant option;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>MariaDB [(none)]&gt; grant all privileges on *.* to root@localhost identified by &#8216;test123&#8242; with grant option;<br \/>\nQuery OK, 0 rows affected (0.00 sec)<\/p>\n<p>Create a new user to Galera Server, and set the password.<\/p>\n<p>&#8220;New User: root&#8221;,: and then to the &#8220;password test123&#8243;.<\/p>\n<p>7. Once this is added, you can now start the first Galera cluster with the command. Make sure that the mysql service is stopped first. as at step5 we have started mysql to create a test database<\/p>\n<p>service mysql start<\/p>\n<p>[root@apache2 ~]# netstat -antp<br \/>\nActive Internet connections (servers and established)<br \/>\nProto Recv-Q Send-Q Local Address Foreign Address State PID\/Program name<br \/>\ntcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2605\/mysqld<br \/>\ntcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1085\/sshd<br \/>\ntcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN 2605\/mysqld<\/p>\n<p>Now you would like to make galera2 joined the primary cluster i.e apache1.<\/p>\n<p>Simple set up the apache2 \/etc\/my.cnf.d\/server.cnf file and under [galera] enter the following parameter.<br \/>\nThe only difference is the wsrep_node_name, wsrep_node_address and the gcomm value where you need to add the first cluster.<br \/>\ndo not forget to adjust the wsrep_node_address and wsrep_node_name variables.<\/p>\n<p>[root@apache1 ~]#<br \/>\n#Mandatory settings<br \/>\nwsrep_on=ON<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=&#8217;gcomm:\/\/apache1.rmohan.com,apache2.rmohan.com,apache3.rmohan.com&#8217;<br \/>\nwsrep_cluster_name=&#8217;galera&#8217;<br \/>\nwsrep_node_address=&#8217;192.168.1.71&#8242;<br \/>\nwsrep_node_name=&#8217;apache1.rmohan.com&#8217;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_slave_threads=4<br \/>\nbinlog_format=row<br \/>\ndefault_storage_engine=InnoDB<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nbind-address=0.0.0.0<br \/>\ninnodb_locks_unsafe_for_binlog=1<br \/>\n#wsrep_provider_options=&#8221;socket.ssl_key=\/etc\/pki\/galera\/galera.key; socket.ssl_cert=\/etc\/pki\/galera\/galera.crt;&#8221;<\/p>\n<p>[root@apache1 ~]#<\/p>\n<p>[root@apache2 ~]#<br \/>\n# Mandatory settings<br \/>\nwsrep_on=ON<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=&#8217;gcomm:\/\/apache1.rmohan.com,apache2.rmohan.com,apache3.rmohan.com&#8217;<br \/>\nwsrep_cluster_name=&#8217;galera&#8217;<br \/>\nwsrep_node_address=&#8217;192.168.1.72&#8242;<br \/>\nwsrep_node_name=&#8217;apache2.rmohan.com&#8217;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_slave_threads=4<br \/>\nbinlog_format=row<br \/>\ndefault_storage_engine=InnoDB<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nbind-address=0.0.0.0<br \/>\ninnodb_locks_unsafe_for_binlog=1<br \/>\n#wsrep_provider_options=&#8221;socket.ssl_key=\/etc\/pki\/galera\/galera.key; socket.ssl_cert=\/etc\/pki\/galera\/galera.crt;&#8221;<br \/>\n[root@apache2 ~]#<br \/>\ndo not forget to adjust the wsrep_node_address and wsrep_node_name variables.<\/p>\n<p>[root@apache3 ~]#<br \/>\n# Mandatory settings<br \/>\nwsrep_on=ON<br \/>\nwsrep_provider=\/usr\/lib64\/galera\/libgalera_smm.so<br \/>\nwsrep_cluster_address=&#8217;gcomm:\/\/apache1.rmohan.com,apache2.rmohan.com,apache3.rmohan.com&#8217;<br \/>\nwsrep_cluster_name=&#8217;galera&#8217;<br \/>\nwsrep_node_address=&#8217;192.168.1.74&#8242;<br \/>\nwsrep_node_name=&#8217;apache3.rmohan.com&#8217;<br \/>\nwsrep_sst_method=rsync<br \/>\nwsrep_slave_threads=4<br \/>\nbinlog_format=row<br \/>\ndefault_storage_engine=InnoDB<br \/>\ninnodb_autoinc_lock_mode=2<br \/>\nbind-address=0.0.0.0<br \/>\ninnodb_locks_unsafe_for_binlog=1<br \/>\n#wsrep_provider_options=&#8221;socket.ssl_key=\/etc\/pki\/galera\/galera.key; socket.ssl_cert=\/etc\/pki\/galera\/galera.crt;&#8221;<\/p>\n<p>[root@apache3 ~]#<br \/>\ndo not forget to adjust the wsrep_node_address and wsrep_node_name variables.<\/p>\n<p>[root@apache2 ~]# less \/var\/log\/messages<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: wsrep_sst_grab()<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: Start replication<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: Setting initial position to 60149e36-1b72-11e6-910f-029ebfb18fbb:0<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: protonet asio version 0<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: Using CRC-32C for message checksums.<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: backend: asio<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Warning] WSREP: access file(\/var\/lib\/mysql\/\/gvwstate.dat) failed(No such file or directory)<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: restore pc from disk failed<br \/>\nMay 16 22:33:24 apache2 mysqld: 2016-05-16 22:33:24 139713247639680 [Note] WSREP: GMCast version 0<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Warning] WSREP: Failed to resolve tcp:\/\/apache3.rmohan.com:4567<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Note] WSREP: (258ce90a, &#8216;tcp:\/\/0.0.0.0:4567&#8217;) listening at tcp:\/\/0.0.0.0:4567<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Note] WSREP: (258ce90a, &#8216;tcp:\/\/0.0.0.0:4567&#8217;) multicast: , ttl: 1<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Note] WSREP: EVS version 0<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Note] WSREP: gcomm: connecting to group &#8216;galera&#8217;, peer &#8216;apache1.rmohan.com:,apache2.rmohan.com:,apache3.rmohan.com:&#8217;<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Warning] WSREP: (258ce90a, &#8216;tcp:\/\/0.0.0.0:4567&#8217;) address &#8216;tcp:\/\/192.168.1.72:4567&#8217; points to own listening address, black<br \/>\nlisting<br \/>\nMay 16 22:33:25 apache2 mysqld: 2016-05-16 22:33:25 139713247639680 [Note] WSREP: (258ce90a, &#8216;tcp:\/\/0.0.0.0:4567&#8217;) turning message relay requesting on, nonlive peers: tcp:\/\/192.168.1.74:4567<br \/>\nMay 16 22:33:27 apache2 mysqld: 2016-05-16 22:33:27 139713247639680 [Note] WSREP: declaring 16c80092 at tcp:\/\/192.168.1.74:4567 stable<br \/>\nMay 16 22:33:27 apache2 mysqld: 2016-05-16 22:33:27 139713247639680 [Note] WSREP: declaring 1f8d7692 at tcp:\/\/192.168.1.71:4567 stable<br \/>\nMay 16 22:33:27 apache2 mysqld: 2016-05-16 22:33:27 139713247639680 [Note] WSREP: Node 16c80092 state prim<br \/>\nMay 16 22:33:27 apache2 mysqld: 2016-05-16 22:33:27 139713247639680 [Note] WSREP: view(view_id(PRIM,16c80092,7) memb {<br \/>\nMay 16 22:33:27 apache2 mysqld: 16c80092,0<br \/>\nMay 16 22:33:27 apache2 mysqld: 1f8d7692,0<br \/>\nMay 16 22:33:27 apache2 mysqld: 258ce90a,0<br \/>\nMay 16 22:33:27 apache2 mysqld: } joined {<br \/>\nMay 16 22:33:27 apache2 mysqld: } left {<br \/>\nMay 16 22:33:27 apache2 mysqld: } partitioned {<br \/>\nMay 16 22:33:27 apache2 mysqld: })<br \/>\nMay 16 22:33:27 apache2 mysqld: 2016-05-16 22:33:27 139713247639680 [Note] WSREP: save pc into disk<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247639680 [Note] WSREP: gcomm: connected<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247639680 [Note] WSREP: Changing maximum packet size to 64500, resulting msg size: 32636<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247639680 [Note] WSREP: Shifting CLOSED -&gt; OPEN (TO: 0)<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247639680 [Note] WSREP: Opened channel &#8216;galera&#8217;<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247639680 [Note] WSREP: Waiting for SST to complete.<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 2, memb_num = 3<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: STATE EXCHANGE: Waiting for state UUID.<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: STATE EXCHANGE: sent state msg: 27845dea-1b73-11e6-82bb-cbc3208d7287<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: STATE EXCHANGE: got state msg: 27845dea-1b73-11e6-82bb-cbc3208d7287 from 0 (apache3.rmohan.com)<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: STATE EXCHANGE: got state msg: 27845dea-1b73-11e6-82bb-cbc3208d7287 from 1 (apache1.rmohan.com)<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: STATE EXCHANGE: got state msg: 27845dea-1b73-11e6-82bb-cbc3208d7287 from 2 (apache2.rmohan.com)<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: Quorum results:<br \/>\nMay 16 22:33:28 apache2 mysqld: version = 3,<br \/>\nMay 16 22:33:28 apache2 mysqld: component = PRIMARY,<br \/>\nMay 16 22:33:28 apache2 mysqld: conf_id = 6,<br \/>\nMay 16 22:33:28 apache2 mysqld: members = 3\/3 (joined\/total),<br \/>\nMay 16 22:33:28 apache2 mysqld: act_id = 0,<br \/>\nMay 16 22:33:28 apache2 mysqld: last_appl. = -1,<br \/>\nMay 16 22:33:28 apache2 mysqld: protocols = 0\/7\/3 (gcs\/repl\/appl),<br \/>\nMay 16 22:33:28 apache2 mysqld: group UUID = 60149e36-1b72-11e6-910f-029ebfb18fbb<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: Flow-control interval: [28, 28]<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: Restored state OPEN -&gt; JOINED (0)<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247234816 [Note] WSREP: New cluster view: global state: 60149e36-1b72-11e6-910f-029ebfb18fbb:0, view# 7: Primary, number of nodes: 3, my index: 2, protocol version 3<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139713247639680 [Note] WSREP: SST complete, seqno: 0<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: Member 2.0 (apache2.rmohan.com) synced with group.<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 139712949905152 [Note] WSREP: Shifting JOINED -&gt; SYNCED (TO: 0)<br \/>\nMay 16 22:33:28 apache2 mysqld: 2016-05-16 22:33:28 7f11867ef880 InnoDB: Warning: Using innodb_locks_unsafe_for_binlog is DEPRECATED. This option may be removed in future releases. Please use READ COMMITTED transaction isolation level instead, see http:\/\/dev.mysql.com\/doc\/refman\/5.6\/en\/set-transaction.html.<\/p>\n<p>Initialize the first cluster node<\/p>\n<p>Start MariaDB with the special \u2018-wsrep-new-cluster\u2019 option , Do it on node db1 only so the primary node of the cluster is initialized:<br \/>\n[root@apache1 ~]# \/etc\/init.d\/mysql start &#8211;wsrep-new-cluster<br \/>\nStarting mysql (via systemctl): [ OK ]<br \/>\n[root@apache1<\/p>\n<p>[root@apache1 ~]# mysql -u root -p -e&#8221;show status like &#8216;wsrep%'&#8221;<br \/>\nEnter password:<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| Variable_name | Value |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n| wsrep_apply_oooe | 0.000000 |<br \/>\n| wsrep_apply_oool | 0.000000 |<br \/>\n| wsrep_apply_window | 0.000000 |<br \/>\n| wsrep_causal_reads | 0 |<br \/>\n| wsrep_cert_deps_distance | 0.000000 |<br \/>\n| wsrep_cert_index_size | 0 |<br \/>\n| wsrep_cert_interval | 0.000000 |<br \/>\n| wsrep_cluster_conf_id | 7 |<br \/>\n| wsrep_cluster_size | 3 |<br \/>\n| wsrep_cluster_state_uuid | 60149e36-1b72-11e6-910f-029ebfb18fbb |<br \/>\n| wsrep_cluster_status | Primary |<br \/>\n| wsrep_commit_oooe | 0.000000 |<br \/>\n| wsrep_commit_oool | 0.000000 |<br \/>\n| wsrep_commit_window | 0.000000 |<br \/>\n| wsrep_connected | ON |<br \/>\n| wsrep_evs_delayed | |<br \/>\n| wsrep_evs_evict_list | |<br \/>\n| wsrep_evs_repl_latency | 0\/0\/0\/0\/0 |<br \/>\n| wsrep_evs_state | OPERATIONAL |<br \/>\n| wsrep_flow_control_paused | 0.000000 |<br \/>\n| wsrep_flow_control_paused_ns | 0 |<br \/>\n| wsrep_flow_control_recv | 0 |<br \/>\n| wsrep_flow_control_sent | 0 |<br \/>\n| wsrep_gcomm_uuid | 1f8d7692-1b73-11e6-8496-8af69a3bf125 |<br \/>\n| wsrep_incoming_addresses | 192.168.1.74:3306,192.168.1.71:3306,192.168.1.72:3306 |<br \/>\n| wsrep_last_committed | 0 |<br \/>\n| wsrep_local_bf_aborts | 0 |<br \/>\n| wsrep_local_cached_downto | 18446744073709551615 |<br \/>\n| wsrep_local_cert_failures | 0 |<br \/>\n| wsrep_local_commits | 0 |<br \/>\n| wsrep_local_index | 1 |<br \/>\n| wsrep_local_recv_queue | 0 |<br \/>\n| wsrep_local_recv_queue_avg | 0.000000 |<br \/>\n| wsrep_local_recv_queue_max | 1 |<br \/>\n| wsrep_local_recv_queue_min | 0 |<br \/>\n| wsrep_local_replays | 0 |<br \/>\n| wsrep_local_send_queue | 0 |<br \/>\n| wsrep_local_send_queue_avg | 0.000000 |<br \/>\n| wsrep_local_send_queue_max | 1 |<br \/>\n| wsrep_local_send_queue_min | 0 |<br \/>\n| wsrep_local_state | 4 |<br \/>\n| wsrep_local_state_comment | Synced |<br \/>\n| wsrep_local_state_uuid | 60149e36-1b72-11e6-910f-029ebfb18fbb |<br \/>\n| wsrep_protocol_version | 7 |<br \/>\n| wsrep_provider_name | Galera |<br \/>\n| wsrep_provider_vendor | Codership Oy &lt;info@codership.com&gt; |<br \/>\n| wsrep_provider_version | 25.3.15(r3578) |<br \/>\n| wsrep_ready | ON |<br \/>\n| wsrep_received | 4 |<br \/>\n| wsrep_received_bytes | 856 |<br \/>\n| wsrep_repl_data_bytes | 0 |<br \/>\n| wsrep_repl_keys | 0 |<br \/>\n| wsrep_repl_keys_bytes | 0 |<br \/>\n| wsrep_repl_other_bytes | 0 |<br \/>\n| wsrep_replicated | 0 |<br \/>\n| wsrep_replicated_bytes | 0 |<br \/>\n| wsrep_thread_count | 5 |<br \/>\n+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br \/>\n[root@apache1 ~]#<\/p>\n<p>Some important information in the output are the following lines:<\/p>\n<p>wsrep_local_state_comment | Synced wsrep_incoming_addresses | 192.168.1.74:3306,192.168.1.71:3306,192.168.1.72:3306 wsrep_cluster_size | 1 wsrep_ready | ON all-database.sql<\/p>\n<p>And then restoring it on the node to be connected with<br \/>\n[root@apache1 ~]# mysql -u root -p -e &#8216;CREATE DATABASE apachetest;&#8217;<br \/>\nEnter password:<br \/>\n[root@apache1 ~]# mysql -u root -p -e &#8216;CREATE TABLE apachetest.mycluster ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(50), ipaddress VARCHAR(20), PRIMARY KEY(id));&#8217;<br \/>\nEnter password:<br \/>\n[root@apache1 ~]# mysql -u root -p -e &#8216;INSERT INTO apachetest.mycluster (name, ipaddress) VALUES (&#8220;apache1&#8221;, &#8220;192.168.1.71&#8221;);&#8217;<br \/>\nEnter password:<br \/>\n[root@apache1 ~]# mysql -u root -p -e &#8216;SELECT * FROM apachetest.mycluster;&#8217;<br \/>\nEnter password:<br \/>\n+&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| id | name | ipaddress |<br \/>\n+&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n| 2 | apache1 | 192.168.1.71 |<br \/>\n+&#8212;-+&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+<br \/>\n[root@apache1 ~]# mysql -u root -p -e &#8216;INSERT INTO apachetest.mycluster (name, ipaddress) VALUES (&#8220;apache2&#8221;, &#8220;192.168.1.72&#8221;);&#8217;<br \/>\nEnter password:<br \/>\n[root@apache1 ~]#<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera-cluster-new-features-deep-dive-webinar-27-638.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5945\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/galera-cluster-new-features-deep-dive-webinar-27-638.jpg\" alt=\"galera-cluster-new-features-deep-dive-webinar-27-638\" width=\"638\" height=\"479\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-new-features-deep-dive-webinar-27-638.jpg 638w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-new-features-deep-dive-webinar-27-638-300x225.jpg 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-new-features-deep-dive-webinar-27-638-150x113.jpg 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/galera-cluster-new-features-deep-dive-webinar-27-638-400x300.jpg 400w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5947\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg.png\" alt=\"itfish_40768_0.jpg\" width=\"1598\" height=\"876\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg.png 1598w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg-300x164.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg-768x421.png 768w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg-1024x561.png 1024w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg-150x82.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2016\/05\/itfish_40768_0.jpg-400x219.png 400w\" sizes=\"(max-width: 1598px) 100vw, 1598px\" \/><\/a><\/p>\n<p><strong>Troubleshooting<\/strong><br \/>\n<strong>Name Resolution<\/strong><\/p>\n<p>If the node trying to connect to an establish cluster is reporting the error:<\/p>\n<p>130307 15:14:52 [Warning] IP address &#8216;192.168.1.71&#8217; could not be resolved: Name or service not known<\/p>\n<p>And the node it is trying to connect to is displaying the error:<\/p>\n<p>&#8216;wsrep_sst_mysqldump &#8211;user &#8216;root&#8217; &#8211;password &#8216;password&#8217; &#8211;host &#8216;192.168.1.72&#8217; &#8211;port &#8216;3306&#8217; &#8211;local-port &#8216;3306&#8217; &#8211;socket &#8216;\/var\/lib\/mysql\/mysql.sock&#8217; &#8211;gtid &#8216;4c754641-e45a-11e2-0800-425dfc14f8f4:390&#8221; failed: 1 (Operation not permitted)<\/p>\n<p>The try adding the following option to the nodes configuration files:<\/p>\n<p>skip-name-resolve<\/p>\n<p>Be aware that by doing this, MariaDB will no longer use credentials with host names. That means you&#8217;ll have to configure the password on root@127.0.0.1 instead of root@localhost.<\/p>\n<p>Credentials<br \/>\nIf the node trying to connect to an establish cluster is reporting the error:<\/p>\n<p>WSREP: gcs\/src\/gcs_group.c:gcs_group_handle_join_msg():719: Will never receive state. Need to abort.<\/p>\n<p>And the node it is trying to connect to is displaying the error:<\/p>\n<p>[ERROR] WSREP: Try 1\/3: &#8216;wsrep_sst_mysqldump &#8211;user &#8216;root&#8217; &#8211;password &#8216;password&#8217; &#8211;host &#8216;192.168.1.71&#8217; &#8211;port &#8216;3306&#8217; &#8211;local-port &#8216;3306&#8217; &#8211;socket &#8216;\/var\/lib\/mysql\/mysql.sock&#8217; &#8211;gtid &#8216;4c754641-e45a-11e2-0800-425dfc14f8f4:420&#8221; failed: 1 (Operation not permitted)<br \/>\nERROR 1045 (28000): Access denied for user &#8216;root&#8217;@&#8217;192.168.1.72&#8217; (using password: YES)<\/p>\n<p>Make sure the account on the node trying to connect to the cluster is correct. The established node that is being connected to is trying to send the database state to the connecting node, and is failing to do so because of an authentication error.<\/p>\n<p>Rsync<\/p>\n<p>If you see the error on the established node of<br \/>\nrsync: failed to connect to 192.168.1.72: No route to host (113)<\/p>\n<p>It means that the default state transfer method is Rsync, not mysqldump. To use mysqldump, add the setting<br \/>\nwsrep_sst_method=mysqldump<\/p>\n<p>Or you can open firewall port 4444.<\/p>\n<p>Rsync Wan<br \/>\nIf you see the error<\/p>\n<p>sh: wsrep_sst_rsync_wan: command not found<br \/>\nin the log files of the node trying to connect to a cluster, run<br \/>\ncd \/usr\/bin<\/p>\n<p>ln -s wsrep_sst_rsync wsrep_sst_rsync_wan<\/p>\n<p>File Access<br \/>\nIf you get the error File &#8216;\/var\/lib\/mysql\/aria_log_control&#8217; not found make sure that the file is owned my the user mysql.<br \/>\nI ran into this issue running mysql_install_db as root, which meant that the file was owned by root.<\/p>\n<p>Tips and Tricks<\/p>\n<p>Initial Setup<\/p>\n<p>You can find out how large your SQL database is with the command:<\/p>\n<p>SELECT table_schema,<br \/>\nsum(data_length) \/ 1024 \/ 1024 &#8220;data&#8221;,<br \/>\nsum(index_length) \/ 1024 \/ 1024 &#8220;index&#8221;,<br \/>\nsum( data_length + index_length ) \/ 1024 \/ 1024 &#8220;total&#8221;<br \/>\nFROM information_schema.TABLES<br \/>\nGROUP BY table_schema;<\/p>\n<p>This value includes all the indexes, and represents the amount of data MariaDB will transfer to an empty node when it joins the cluster.<\/p>\n<p>To save yourself some time, initialise the nodes that will join the cluster by dumping the SQL data into a file with the command:<\/p>\n<p>mysqldump -u root -ppassword &#8211;all-databases &gt; all-database.sql<\/p>\n<p>And then restoring it on the node to be connected with<\/p>\n<p>mysql -u root -ppassword &lt; all-database.sql<\/p>\n<p>Because the backup will not contain the indexes, and can be compressed, you&#8217;ll find that you&#8217;ll be able to get a remote node up to a relatively recent initial state far more quickly than attempting to sync the entire database through the MariaDB state transfer. In my case a 5GB database could be backed up into a 600 MB compressed SQL file.<\/p>\n<p>It doesn&#8217;t matter if the database changes between when you backed it up and when the node connects, because the state transfer will take care of that for you.<\/p>\n<p>Save Bandwidth<\/p>\n<p>Use the setting<br \/>\nwsrep_sst_method=rsync_wan<br \/>\nTo save some bandwidth for state transfers over a WAN connection.<\/p>\n<p>mysql -u root -ppassword &lt; all-database.sql<\/p>\n<p>Because the backup will not contain the indexes, and can be compressed, you&#8217;ll find that you&#8217;ll be able to get a remote node up to a relatively recent initial state far more quickly than attempting to sync the entire database through the MariaDB state transfer. In my case a 5GB database could be backed up into a 600 MB compressed SQL file.<\/p>\n<p>It doesn&#8217;t matter if the database changes between when you backed it up and when the node connects, because the state transfer will take care of that for you.<\/p>\n<p>Save Bandwidth<\/p>\n<p>Use the setting<br \/>\nwsrep_sst_method=rsync_wan<br \/>\nTo save some bandwidth for state transfers over a WAN connection.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MariaDB is a branch of Mysql, it has been widely used in open source projects, such as hot openstack, therefore, in order to ensure high availability of the service, while increasing the load capacity of the system, the cluster deployment is essential.<\/p>\n<p>MariaDB Galera Cluster Introduction<\/p>\n<p>MariaDB Galera Cluster is an open source MariaDB synchronous [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5937"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5937"}],"version-history":[{"count":4,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5937\/revisions"}],"predecessor-version":[{"id":5949,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5937\/revisions\/5949"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}