3

Following documentation on how to set up a MariaDB Galera cluster, I simply created the proper config files and started my primary db server with the galera_new_cluster command (I'm running RHEL7). According to the documentation, at that point you should be able to run:

SHOW STATUS LIKE 'wsrep_cluster_size';

And see

+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| wsrep_cluster_size | 1     | 
+--------------------+-------+

However, I see wsrep_cluster_size of zero with these other relevant values:

MariaDB [(none)]>  show global status like 'wsrep%';
+--------------------------+----------------------+
| Variable_name            | Value                |
+--------------------------+----------------------+
| wsrep_cluster_conf_id    | 18446744073709551615 |
| wsrep_cluster_size       | 0                    |
| wsrep_cluster_state_uuid |                      |
| wsrep_cluster_status     | Disconnected         |
| wsrep_connected          | OFF                  |
| wsrep_local_bf_aborts    | 0                    |
| wsrep_local_index        | 18446744073709551615 |
| wsrep_provider_name      |                      |
| wsrep_provider_vendor    |                      |
| wsrep_provider_version   |                      |
| wsrep_ready              | OFF                  |
| wsrep_thread_count       | 0                    |
+--------------------------+----------------------+

My settings in /etc/my.cnf.d/server.cnf are:

bind_address=172.28.7.15
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_name="galera_cluster"
wsrep_cluster_address="gcomm://172.28.7.15,172.28.7.18,172.28.7.19"
wsrep_node_address=172.28.7.15
wsrep_node_name='node01'
wsrep_slave_threads=1
wsrep_certify_nonPK=1
wsrep_max_ws_rows=131072
wsrep_max_ws_size=1073741824
wsrep_debug=1
wsrep_convert_LOCK_to_trx=0
wsrep_retry_autocommit=1
wsrep_auto_increment_control=1
wsrep_drupal_282555_workaround=0
wsrep_causal_reads=0
wsrep_notify_cmd=
wsrep_sst_method=rsync

And I've confirmed that the variables are loaded using SHOW VARIABLES.

I feel like I'm following the documentation exactly and it's just not showing what I expect. The only warnings in logs are warnings about SSL not being set up - is that required?

ctrlaltdel
  • 37
  • 1
  • 1
  • 4

2 Answers2

4

You mentioned you didn't see any WSREP logs in /var/log/mariadb/mariadb.log. Perhaps wsrep_on option is set to OFF. Try setting it to ON.

Lots of documentation assumes MariaDB Galera 10.0. But in 10.1 and higher, wsrep_on defaults to OFF.

Default Value: OFF (>= MariaDB 10.1), ON (<= MariaDB Galera Cluster 10.0) https://mariadb.com/kb/en/mariadb/galera-cluster-system-variables/#wsrep_on

Fanatic
  • 751
  • 3
  • 5
  • Thanks @Fanatic ! I was having the same problem as the original poster. Adding wsrep_on to my config solved everything :) – Phil Jan 30 '17 at 23:49
  • 4
    Hi, I have set wsrep_on=ON in /etc/my.cnf.d/server.cnf file but when I start mysql service "show global variables like 'wsrep_on'" still OFF what is the problem – Yuan Chen Jun 23 '17 at 11:48
  • And I try to `set global wsrep_on = ON`, then I got `ERROR 1210 (HY000): WSREP (galera) can't be enabled if innodb_lock_schedule_algorithm=VATS. Please configure innodb_lock_schedule_algorithm=FCFS and restart.` – zx1986 Apr 16 '18 at 08:20
0

For Centos 7, edit your /etc/my.cnf file and

setenforce 0

write it on your all nodes. Then start your cluster and connect nodes.

Elvis23
  • 1
  • 4