@@ -16,7 +16,7 @@ datadir=/var/lib/mysql | |||
socket=/var/run/mysqld/mysqld.sock | |||
pid_file=mysqld.pid | |||
port=3306 | |||
log_error=/var/log/mysql.log | |||
log_error={{ service.log_file }} | |||
log_warnings=2 | |||
#log_output=FILE | |||
### INNODB OPTIONS | |||
@@ -184,6 +184,6 @@ socket=/var/run/mysqld/mysqld.sock | |||
default_character_set=utf8 | |||
[MYSQLD_SAFE] | |||
pid_file=mysqld.pid | |||
log_error=/var/log/mysql.log | |||
log_error={{ service.log_file }} | |||
basedir=/usr/ | |||
datadir=/var/lib/mysql |
@@ -16,7 +16,7 @@ datadir=/var/lib/mysql | |||
socket=/var/run/mysqld/mysqld.sock | |||
pid_file=mysqld.pid | |||
port=3306 | |||
log_error=/var/log/mysql.log | |||
log_error={{ service.log_file }} | |||
log_warnings=2 | |||
#log_output=FILE | |||
### INNODB OPTIONS | |||
@@ -97,6 +97,6 @@ socket=/var/run/mysqld/mysqld.sock | |||
default_character_set=utf8 | |||
[MYSQLD_SAFE] | |||
pid_file=mysqld.pid | |||
log_error=/var/log/mysql.log | |||
log_error={{ service.log_file }} | |||
basedir=/usr/ | |||
datadir=/var/lib/mysql |
@@ -16,7 +16,7 @@ datadir=/var/lib/mysql | |||
socket=/var/run/mysqld/mysqld.sock | |||
pid_file=mysqld.pid | |||
port=3306 | |||
log_error=/var/log/mysql.log | |||
log_error={{ service.log_file }} | |||
log_warnings=2 | |||
#log_output=FILE | |||
### INNODB OPTIONS | |||
@@ -183,6 +183,6 @@ socket=/var/run/mysqld/mysqld.sock | |||
default_character_set=utf8 | |||
[MYSQLD_SAFE] | |||
pid_file=mysqld.pid | |||
log_error=/var/log/mysql.log | |||
log_error={{ service.log_file }} | |||
basedir=/usr/ | |||
datadir=/var/lib/mysql |
@@ -1,17 +1,18 @@ | |||
{%- from "galera/map.jinja" import slave with context -%} | |||
#!/bin/bash | |||
service mysql start | |||
service {{ slave.service }} start | |||
counter=40 | |||
while [ $counter -gt 0 ] | |||
do | |||
service mysql status | |||
service {{ slave.service }} status | |||
if [[ $? -eq 0 ]]; then | |||
exit 0 | |||
fi | |||
counter=$(( $counter - 1 )) | |||
counter=$(( $counter - 1 )) | |||
sleep 2 | |||
done | |||
exit 1 | |||
exit 1 |
@@ -3,11 +3,13 @@ | |||
'Debian': { | |||
'pkgs': ['mysql-server-wsrep', 'galera', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup-21', 'socat'], | |||
'service': 'mysql', | |||
'log_file': '/var/log/mysql.log', | |||
'config': '/etc/mysql/my.cnf', | |||
}, | |||
'RedHat': { | |||
'pkgs': ['MySQL-server', 'galera', 'MySQL-client', 'MySQL-python', 'rsync'], | |||
'service': 'mysql', | |||
'pkgs': ['mariadb-galera-cluster', 'mariadb', 'MySQL-python', 'rsync'], | |||
'service': 'mysqld', | |||
'log_file': '/var/log/mariadb/mariadb.log', | |||
'config': '/etc/mysql/my.cnf', | |||
}, | |||
}, merge=salt['pillar.get']('galera:master')) %} | |||
@@ -16,11 +18,13 @@ | |||
'Debian': { | |||
'pkgs': ['mysql-server-wsrep', 'galera', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup-21', 'socat'], | |||
'service': 'mysql', | |||
'log_file': '/var/log/mysql.log', | |||
'config': '/etc/mysql/my.cnf', | |||
}, | |||
'RedHat': { | |||
'pkgs': ['MySQL-server', 'galera', 'MySQL-client', 'MySQL-python', 'rsync'], | |||
'service': 'mysql', | |||
'pkgs': ['mariadb-galera-cluster', 'mariadb', 'MySQL-python', 'rsync'], | |||
'service': 'mysqld', | |||
'log_file': '/var/log/mariadb/mariadb.log', | |||
'config': '/etc/mysql/my.cnf', | |||
}, | |||
}, merge=salt['pillar.get']('galera:slave')) %} |
@@ -35,7 +35,7 @@ galera_bootstrap_temp_config: | |||
galera_bootstrap_start_service: | |||
service.running: | |||
- name: mysql | |||
- name: {{ master.service }} | |||
- require: | |||
- file: galera_bootstrap_temp_config | |||
@@ -97,4 +97,4 @@ galera_service: | |||
- enable: true | |||
- reload: true | |||
{%- endif %} | |||
{%- endif %} |
@@ -35,7 +35,7 @@ galera_bootstrap_temp_config: | |||
galera_bootstrap_start_service: | |||
service.running: | |||
- name: mysql | |||
- name: {{ slave.service }} | |||
- require: | |||
- file: galera_bootstrap_temp_config | |||
@@ -70,6 +70,7 @@ galera_bootstrap_start_service_final: | |||
cmd.script: | |||
- name: slave_bootstrap | |||
- source: salt://galera/files/slave_bootstrap.sh | |||
- template: jinja | |||
- require: | |||
- file: galera_bootstrap_init_config | |||
@@ -98,4 +99,4 @@ galera_service: | |||
- enable: true | |||
- reload: true | |||
{%- endif %} | |||
{%- endif %} |