From 2dc301bb1d3542e25af00ab95088ef4f02a3aad9 Mon Sep 17 00:00:00 2001 From: Dick Visser Date: Fri, 4 May 2018 15:25:21 +0200 Subject: [PATCH] Make sure a single node Galera cluster always starts up as a new cluster. --- roles/db/templates/server.cnf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/db/templates/server.cnf.j2 b/roles/db/templates/server.cnf.j2 index 3ec6f044..a74950d3 100644 --- a/roles/db/templates/server.cnf.j2 +++ b/roles/db/templates/server.cnf.j2 @@ -40,7 +40,7 @@ innodb_file_per_table innodb_flush_log_at_trx_commit=2 wsrep_provider=/usr/lib64/galera/libgalera_smm.so -wsrep_cluster_address="gcomm://{% for host in groups['dbcluster'] %}{{ hostvars[host]['backend_ipv4'] }}{% if not loop.last %},{% endif %}{% endfor %}" +wsrep_cluster_address="gcomm://{% if groups['dbcluster']|length > 1 %}{% for host in groups['dbcluster'] %}{{ hostvars[host]['backend_ipv4'] }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}" wsrep_cluster_name='{{ mariadb_cluster_name }}' wsrep_node_address='{{ backend_ipv4 }}:4567' wsrep_node_name='{{ inventory_hostname }}'