Fix mysql bootstrap
The lightsout recover patch broke multinode mysql. Also the lightsout recovery didnt probably pass the --wsrep-new-cluster flag. This updates the mariadb bootstrap to work with multinode again. Closes-Bug: #1559480 Related-Id: I903c3bcd069af39814bcabcef37684b1f043391f Change-Id: I1ec91a8b2144930ea8f04cc1c201b53712352e4e
This commit is contained in:
parent
05b6995f63
commit
afce10dea4
@ -1,14 +1,31 @@
|
|||||||
---
|
---
|
||||||
- name: Starting MariaDB bootstrap container
|
- name: Running MariaDB bootstrap container
|
||||||
kolla_docker:
|
kolla_docker:
|
||||||
action: "start_container"
|
action: "start_container"
|
||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
|
detach: False
|
||||||
environment:
|
environment:
|
||||||
KOLLA_BOOTSTRAP:
|
KOLLA_BOOTSTRAP:
|
||||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
DB_ROOT_PASSWORD: "{{ database_password }}"
|
DB_ROOT_PASSWORD: "{{ database_password }}"
|
||||||
DB_MAX_TIMEOUT: "{{ database_max_timeout }}"
|
DB_MAX_TIMEOUT: "{{ database_max_timeout }}"
|
||||||
ARGS: "--wsrep-new-cluster"
|
image: "{{ mariadb_image_full }}"
|
||||||
|
labels:
|
||||||
|
BOOTSTRAP:
|
||||||
|
name: "bootstrap_mariadb"
|
||||||
|
restart_policy: "never"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
- "mariadb:/var/lib/mysql"
|
||||||
|
|
||||||
|
- name: Starting first MariaDB container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
environment:
|
||||||
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
|
BOOTSTRAP_ARGS: "--wsrep-new-cluster"
|
||||||
image: "{{ mariadb_image_full }}"
|
image: "{{ mariadb_image_full }}"
|
||||||
labels:
|
labels:
|
||||||
BOOTSTRAP:
|
BOOTSTRAP:
|
||||||
@ -18,14 +35,3 @@
|
|||||||
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
|
- "{{ node_config_directory }}/mariadb/:{{ container_config_directory }}/:ro"
|
||||||
- "kolla_logs:/var/log/kolla/"
|
- "kolla_logs:/var/log/kolla/"
|
||||||
- "mariadb:/var/lib/mysql"
|
- "mariadb:/var/lib/mysql"
|
||||||
|
|
||||||
- name: Waiting for MariaDB service to be ready
|
|
||||||
command: "docker exec mariadb ls /var/lib/mysql/{{ item }}"
|
|
||||||
register: bootstrap_result
|
|
||||||
until: bootstrap_result | success
|
|
||||||
changed_when: False
|
|
||||||
retries: 6
|
|
||||||
delay: 10
|
|
||||||
with_items:
|
|
||||||
- cluster.exists
|
|
||||||
- mariadb.pid
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
common_options: "{{ docker_common_options }}"
|
common_options: "{{ docker_common_options }}"
|
||||||
environment:
|
environment:
|
||||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
ARGS: "--wsrep-new-cluster"
|
BOOTSTRAP_ARGS: "--wsrep-new-cluster"
|
||||||
image: "{{ mariadb_image_full }}"
|
image: "{{ mariadb_image_full }}"
|
||||||
labels:
|
labels:
|
||||||
BOOTSTRAP:
|
BOOTSTRAP:
|
||||||
|
@ -13,7 +13,7 @@ datadir=/var/lib/mysql/
|
|||||||
|
|
||||||
wsrep_cluster_address=gcomm://{% if (groups['mariadb'] | length) > 1 %}{% for host in groups['mariadb'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
|
wsrep_cluster_address=gcomm://{% if (groups['mariadb'] | length) > 1 %}{% for host in groups['mariadb'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
|
||||||
|
|
||||||
wsrep_provider_options="gmcast.listen_addr=tcp://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_wsrep_port }};ist.recv_addr={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_ist_port }}"
|
wsrep_provider_options=gmcast.listen_addr=tcp://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_wsrep_port }};ist.recv_addr={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_ist_port }}
|
||||||
|
|
||||||
wsrep_node_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}
|
wsrep_node_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}
|
||||||
wsrep_sst_receive_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_sst_port }}
|
wsrep_sst_receive_address={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ mariadb_sst_port }}
|
||||||
|
@ -32,8 +32,12 @@ if [[ $(stat -c %a /var/log/kolla/mariadb) != "755" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# This catches all cases of the BOOTSTRAP variable being set, including empty
|
# This catches all cases of the BOOTSTRAP variable being set, including empty
|
||||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then
|
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||||
mysql_install_db
|
mysql_install_db
|
||||||
bootstrap_db
|
bootstrap_db
|
||||||
touch /var/lib/mysql/cluster.exists
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${!BOOTSTRAP_ARGS[@]}" ]]; then
|
||||||
|
ARGS="${BOOTSTRAP_ARGS}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user