subutai-attic / peer-os-plugins

1 stars 5 forks source link

Can I use Galera plugin to create a cluster and just use the DB now for any application? #137

Open akarasulu opened 7 years ago

akarasulu commented 7 years ago

I created a galera cluster with two nodes. Now I want to install wordpress and use the mysql database. Will it replicate now?

eabyshev-zz commented 7 years ago

@akarasulu yes, replication is working. I created cluster with three nodes. There is config:

[mysqld]
# Cluster node configurations
wsrep_cluster_address="gcomm://172.19.213.2,172.19.213.4,172.19.213.3"
wsrep_node_address="172.19.213.3"
innodb_buffer_pool_size=400M

# Mandatory settings to enable Galera
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
binlog_format=ROW
default-storage-engine=InnoDB
innodb_autoinc_lock_mode=2
innodb_doublewrite=1
query_cache_size=0
#bind-address=0.0.0.0

# Galera synchronisation configuration
wsrep_sst_method=rsync

Cluster status:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 37
Server version: 10.1.19-MariaDB-1~trusty mariadb.org binary distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 3     |
+--------------------+-------+
1 row in set (0.00 sec)

MariaDB [(none)]>

screenshot from 2016-12-27 11 26 04