Fixes an issue with AIO and galera clusters

AIO nodes had an address in the gcomm list which would prevent AIO
containers from starting appropriately.

Change-Id: I6db8c831ef9f9c0348748eb9539db326dc0df048
Closes-Bug: #1472481
This commit is contained in:
Sam Yaple 2015-07-08 06:03:07 +00:00
parent 5179042a44
commit 8f194e50a0
4 changed files with 11 additions and 4 deletions

View File

@ -5,9 +5,16 @@
- include: start.yml
# We use register as a test to see whether the database is active and ready to
# communicate. This run on all hosts that have a database and attempts to talk
# to the local database rather than the vip,
- include: register.yml
# This will restart the container we initially used to bootstrap the cluster to
# make it match the other containers environment-wise. This also prevents a
# change from showing up when rerunning the playbooks
- include: start.yml
# Since the last start.yml may have recreated some containers we must wait and
# check the health again to ensure the hosts are active.
- include: register.yml

View File

@ -1,7 +1,7 @@
---
- name: Creating haproxy mysql user
mysql_user:
login_host: "{{ database_address }}"
login_host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
login_user: "{{ database_user }}"
login_password: "{{ database_password }}"
name: "haproxy"

View File

@ -9,5 +9,5 @@
- "{{ node_config_directory }}/mariadb/:/opt/kolla/mariadb/:ro"
container_volumes_from:
- "mariadb_data"
when: delegate_host != 'None' or
( delegate_host == 'None' and inventory_hostname != groups['database'][0])
when: delegate_host != 'None' or (groups['database'] | length) == 1 or
( delegate_host == 'None' and inventory_hostname != groups['database'][0] )

View File

@ -8,7 +8,7 @@ query_cache_type=0
innodb_log_file_size=48M
wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address=gcomm://{% for host in groups['database'] %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endfor %}
wsrep_cluster_address=gcomm://{% if (groups['database'] | length) > 1 %}{% for host in groups['database'] %}{{ hostvars[host]['ansible_hostname'] }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
wsrep_cluster_name="{{ database_cluster_name }}"
wsrep_node_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}