Search code examples
wordpressmariadbgalera

MariaDB Galera Cluster: issue with replication


Here is my setup:

  1. 4 VMs (running on CentOS 7)
    • VM1 with mariadb-client and maxscale for load balancing (I have tried haproxy, results are the same). httpd and php (I am testing this with WordPress installation)
    • VM2, VM3, VM4 with mariadb-server, galera, rsync
  2. Software installation
  3. Editing config files
  4. Staring the cluster
    • on VM2 I have executed galera_new_cluster
    • on VM3 and VM4 I have executed systemctl start mariadb
  5. Checking the cluster
  6. Creating maxscale user and wordpress users
  7. The main issue.
    • after importing WordPress database, it is properly created only on VM2 only. On VM3 and VM4 the database and tables are created, however, for some reason they are empty.
    • If I access wordpress database through MySQL CLI using my wordpress user and create new table with some data it gets replicated, but when I add user to my wp_users table (or add user through wp-admin) it is not replicated. The record gets created only on VM2 and not on VM3 and VM4.

Solution

  • check to see if the tables are innodb instead of isam. I know on my setup when I imported old isam tables, the tables would appear, but the data wouldn't replicate. I had to convert all of the tables to innodb.