Browse Source

galera bootstrap improvements

Conflicts:
	galera/master.sls
	galera/slave.sls
tags/1.0
Jakub Pavlik 9 years ago
parent
commit
4e4575f775
3 changed files with 23 additions and 14 deletions
  1. +1
    -1
      galera/files/bootstrap.sh
  2. +11
    -8
      galera/master.sls
  3. +11
    -5
      galera/slave.sls

galera/files/slave_bootstrap.sh → galera/files/bootstrap.sh View File



service {{ slave.service }} start service {{ slave.service }} start


counter=40
counter=70


while [ $counter -gt 0 ] while [ $counter -gt 0 ]
do do

+ 11
- 8
galera/master.sls View File

- require: - require:
- pkg: galera_packages - pkg: galera_packages


{%- if salt['cmd.run']('test -e /root/.galera_bootstrap; echo $?') != '0' %}
{%- if salt['cmd.run']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %}


galera_bootstrap_temp_config: galera_bootstrap_temp_config:
file.managed: file.managed:
- file: galera_init_script - file: galera_init_script


galera_bootstrap_start_service: galera_bootstrap_start_service:
service.running:
- name: {{ master.service }}
cmd.script:
- name: master_initial_bootstrap
- source: salt://galera/files/bootstrap.sh
- template: jinja
- require: - require:
- file: galera_bootstrap_temp_config - file: galera_bootstrap_temp_config


cmd.run: cmd.run:
- name: mysqladmin password "{{ master.admin.password }}" - name: mysqladmin password "{{ master.admin.password }}"
- require: - require:
- service: galera_bootstrap_start_service
- cmd: galera_bootstrap_start_service


mysql_bootstrap_update_maint_password: mysql_bootstrap_update_maint_password:
cmd.run: cmd.run:
- service: galera_bootstrap_stop_service - service: galera_bootstrap_stop_service


galera_bootstrap_start_service_final: galera_bootstrap_start_service_final:
service.running:
- name: {{ master.service }}
cmd.script:
- name: master_bootstrap
- source: salt://galera/files/bootstrap.sh
- require: - require:
- file: galera_bootstrap_init_config - file: galera_bootstrap_init_config


galera_bootstrap_finish_flag: galera_bootstrap_finish_flag:
file.touch: file.touch:
- name: /root/.galera_bootstrap
- name: /var/lib/mysql/.galera_bootstrap
- require: - require:
- service: galera_bootstrap_start_service_final
- cmd: galera_bootstrap_start_service_final
- watch_in: - watch_in:
- file: galera_config - file: galera_config



+ 11
- 5
galera/slave.sls View File

- require: - require:
- pkg: galera_packages - pkg: galera_packages


{%- if salt['cmd.run']('test -e /root/.galera_bootstrap; echo $?') != '0' %}
{%- if salt['cmd.run']('test -e /var/lib/mysql/.galera_bootstrap; echo $?') != '0' %}


galera_bootstrap_temp_config: galera_bootstrap_temp_config:
file.managed: file.managed:
- file: galera_init_script - file: galera_init_script


galera_bootstrap_start_service: galera_bootstrap_start_service:
service.running:
- name: {{ slave.service }}
cmd.script:
- name: slave_initial_bootstrap
- source: salt://galera/files/bootstrap.sh
- template: jinja
- require: - require:
- file: galera_bootstrap_temp_config - file: galera_bootstrap_temp_config


cmd.run: cmd.run:
- name: mysqladmin password "{{ slave.admin.password }}" - name: mysqladmin password "{{ slave.admin.password }}"
- require: - require:
- service: galera_bootstrap_start_service
- cmd: galera_bootstrap_start_service


mysql_bootstrap_update_maint_password: mysql_bootstrap_update_maint_password:
cmd.run: cmd.run:
galera_bootstrap_start_service_final: galera_bootstrap_start_service_final:
cmd.script: cmd.script:
- name: slave_bootstrap - name: slave_bootstrap
<<<<<<< HEAD
- source: salt://galera/files/slave_bootstrap.sh - source: salt://galera/files/slave_bootstrap.sh
- template: jinja - template: jinja
=======
- source: salt://galera/files/bootstrap.sh
>>>>>>> 5f0d683... galera bootstrap improvements
- require: - require:
- file: galera_bootstrap_init_config - file: galera_bootstrap_init_config


galera_bootstrap_finish_flag: galera_bootstrap_finish_flag:
file.touch: file.touch:
- name: /root/.galera_bootstrap
- name: /var/lib/mysql/.galera_bootstrap
- require: - require:
- cmd: galera_bootstrap_start_service_final - cmd: galera_bootstrap_start_service_final
- watch_in: - watch_in:

Loading…
Cancel
Save