suites: | |||||
- name: <%= ENV['SUITE'] %> | |||||
provisioner: | |||||
pillars-from-files: | |||||
neutron.sls: tests/pillar/<%= ENV['SUITE'] %>.sls |
- bundle install | - bundle install | ||||
env: | env: | ||||
- PLATFORM=trevorj/salty-whales:trusty | |||||
- PLATFORM=trevorj/salty-whales:xenial | |||||
- PLATFORM=trevorj/salty-whales:trusty SUITE=master_cluster | |||||
- PLATFORM=trevorj/salty-whales:xenial SUITE=master_cluster | |||||
- PLATFORM=trevorj/salty-whales:trusty SUITE=slave_cluster | |||||
- PLATFORM=trevorj/salty-whales:xenial SUITE=slave_cluster | |||||
before_script: | before_script: | ||||
- set -o pipefail | - set -o pipefail | ||||
- make test | tail | - make test | tail | ||||
script: | script: | ||||
- bundle exec kitchen test -t tests/integration | |||||
- KITCHEN_LOCAL_YAML=.kitchen.travis.yml bundle exec kitchen test -t tests/integration | |||||
notifications: | notifications: | ||||
webhooks: | webhooks: |
user: root | user: root | ||||
password: pass | password: pass | ||||
Additional mysql users: | Additional mysql users: | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
- available_when_readonly: 1 | - available_when_readonly: 1 | ||||
- port 9200 | - port 9200 | ||||
InnoDB parameters | |||||
================= | |||||
Configurable soft parameters | |||||
============================ | |||||
- **innodb_buffer_pool_size** - the default value is 35% of the available ram | |||||
- **galera_innodb_buffer_pool_size** - the default value is 3138M | |||||
- **galera_max_connections** - the default value is 20000 | |||||
Usage: | Usage: | ||||
.. code-block:: yaml | .. code-block:: yaml | ||||
galera: | |||||
master: | |||||
innodb_buffer_pool_size: 1024M | |||||
slave: | |||||
innodb_buffer_pool_size: 1024M | |||||
_param: | |||||
galera_innodb_buffer_pool_size: 1024M | |||||
galera_max_connections: 200 | |||||
Usage | Usage |
{%- if pillar.galera.master is defined %} | |||||
{%- if pillar.galera.get('master',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import master with context %} | {%- from "galera/map.jinja" import master with context %} | ||||
{%- set service = master %} | {%- set service = master %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- if pillar.galera.slave is defined %} | |||||
{%- if pillar.galera.get('slave',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import slave with context %} | {%- from "galera/map.jinja" import slave with context %} | ||||
{%- set service = slave %} | {%- set service = slave %} | ||||
{%- endif %} | {%- endif %} |
# All files in this package is subject to the GPL v2 license | # All files in this package is subject to the GPL v2 license | ||||
# More information is in the COPYING file in the top directory of this package. | # More information is in the COPYING file in the top directory of this package. | ||||
# Copyright (C) 2011 severalnines.com | # Copyright (C) 2011 severalnines.com | ||||
{%- if pillar.galera.master is defined %} | |||||
{%- if pillar.galera.get('master',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import master with context %} | {%- from "galera/map.jinja" import master with context %} | ||||
{%- set service = master %} | {%- set service = master %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- if pillar.galera.slave is defined %} | |||||
{%- if pillar.galera.get('slave',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import slave with context %} | {%- from "galera/map.jinja" import slave with context %} | ||||
{%- set service = slave %} | {%- set service = slave %} | ||||
{%- endif %} | {%- endif %} | ||||
datadir=/var/lib/mysql | datadir=/var/lib/mysql | ||||
bind-address={{ service.bind.address }} | bind-address={{ service.bind.address }} | ||||
port=3306 | port=3306 | ||||
max_connections={{ service.get('max_connections', 20000) }} | |||||
max_connections={{ service.max_connections }} | |||||
default-storage-engine=innodb | default-storage-engine=innodb | ||||
binlog_format=ROW | binlog_format=ROW | ||||
collation-server=utf8_general_ci | collation-server=utf8_general_ci | ||||
#log_error=/var/log/mysql/error.log | #log_error=/var/log/mysql/error.log | ||||
skip-external-locking | skip-external-locking | ||||
skip-name-resolve | skip-name-resolve | ||||
socket = /var/run/mysqld/mysqld.sock | |||||
myisam_sort_buffer_size=64M | myisam_sort_buffer_size=64M | ||||
wait_timeout=1800 | wait_timeout=1800 | ||||
innodb_file_format=Barracuda | innodb_file_format=Barracuda | ||||
innodb_file_per_table=1 | innodb_file_per_table=1 | ||||
{%- if service.innodb_buffer_pool_size is not defined %} | |||||
{% set buffer_pool_size = '%.0fM'%(grains['mem_total']*0.35) %} | |||||
{%- else %} | |||||
{% set buffer_pool_size = service.innodb_buffer_pool_size %} | |||||
{%- endif %} | |||||
innodb_buffer_pool_size={{ buffer_pool_size }} | |||||
innodb_buffer_pool_size={{ service.innodb_buffer_pool_size }} | |||||
innodb_log_file_size=627M | innodb_log_file_size=627M | ||||
innodb_read_io_threads=8 | innodb_read_io_threads=8 | ||||
innodb_write_io_threads=8 | innodb_write_io_threads=8 |
{%- if pillar.galera.master is defined %} | |||||
{%- if pillar.galera.get('master',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import master with context %} | {%- from "galera/map.jinja" import master with context %} | ||||
{%- set service = master %} | {%- set service = master %} | ||||
{%- endif %} | {%- endif %} | ||||
pid_file=/var/lib/mysql/mysql.pid | pid_file=/var/lib/mysql/mysql.pid | ||||
port=3306 | port=3306 | ||||
log_warnings=2 | log_warnings=2 | ||||
innodb_buffer_pool_size=3138M | |||||
innodb_buffer_pool_size={{ service.innodb_buffer_pool_size }} | |||||
innodb_flush_log_at_trx_commit=2 | innodb_flush_log_at_trx_commit=2 | ||||
innodb_file_per_table=1 | innodb_file_per_table=1 | ||||
innodb_data_file_path = ibdata1:100M:autoextend | innodb_data_file_path = ibdata1:100M:autoextend | ||||
skip_name_resolve | skip_name_resolve | ||||
memlock=0 | memlock=0 | ||||
sysdate_is_now=1 | sysdate_is_now=1 | ||||
max_connections={{ service.get('max_connections', 20000) }} | |||||
max_connections={{ service.max_connections }} | |||||
thread_cache_size=512 | thread_cache_size=512 | ||||
query_cache_type = 0 | query_cache_type = 0 | ||||
query_cache_size = 0 | query_cache_size = 0 | ||||
[xtrabackup] | [xtrabackup] | ||||
parallel=4 | parallel=4 | ||||
user={{ service.admin.user }} | user={{ service.admin.user }} | ||||
password={{ service.admin.password }} | |||||
password={{ service.admin.password }} |
# All files in this package is subject to the GPL v2 license | # All files in this package is subject to the GPL v2 license | ||||
# More information is in the COPYING file in the top directory of this package. | # More information is in the COPYING file in the top directory of this package. | ||||
# Copyright (C) 2011 severalnines.com | # Copyright (C) 2011 severalnines.com | ||||
{%- if pillar.galera.master is defined %} | |||||
{%- if pillar.galera.get('master',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import master with context %} | {%- from "galera/map.jinja" import master with context %} | ||||
{%- set service = master %} | {%- set service = master %} | ||||
{%- endif %} | {%- endif %} | ||||
{%- if pillar.galera.slave is defined %} | |||||
{%- if pillar.galera.get('slave',{}).get('enabled', False) %} | |||||
{%- from "galera/map.jinja" import slave with context %} | {%- from "galera/map.jinja" import slave with context %} | ||||
{%- set service = slave %} | {%- set service = slave %} | ||||
{%- endif %} | {%- endif %} | ||||
datadir=/var/lib/mysql | datadir=/var/lib/mysql | ||||
bind-address={{ service.bind.address }} | bind-address={{ service.bind.address }} | ||||
port=3306 | port=3306 | ||||
max_connections={{ service.get('max_connections', 20000) }} | |||||
max_connections={{ service.max_connections }} | |||||
default-storage-engine=innodb | default-storage-engine=innodb | ||||
binlog_format=ROW | binlog_format=ROW | ||||
collation-server=utf8_general_ci | collation-server=utf8_general_ci | ||||
innodb_file_format=Barracuda | innodb_file_format=Barracuda | ||||
innodb_file_per_table=1 | innodb_file_per_table=1 | ||||
innodb_buffer_pool_size=3138M | |||||
innodb_buffer_pool_size={{ service.innodb_buffer_pool_size }} | |||||
innodb_log_file_size=627M | innodb_log_file_size=627M | ||||
innodb_read_io_threads=8 | innodb_read_io_threads=8 | ||||
innodb_write_io_threads=8 | innodb_write_io_threads=8 |
{%- set master = salt['grains.filter_by']({ | {%- set master = salt['grains.filter_by']({ | ||||
'default': { | |||||
'max_connections': 20000, | |||||
'innodb_buffer_pool_size': '3138M', | |||||
}, | |||||
'Debian': { | 'Debian': { | ||||
'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'], | 'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'], | ||||
'service': 'mysql', | 'service': 'mysql', | ||||
'socket': '/var/run/mariadb/mysqld.sock', | 'socket': '/var/run/mariadb/mysqld.sock', | ||||
'config': '/etc/my.cnf', | 'config': '/etc/my.cnf', | ||||
}, | }, | ||||
}, merge=pillar.galera.get('master', {})) %} | |||||
}, merge=pillar.galera.get('master', {}), base='default') %} | |||||
{%- set slave = salt['grains.filter_by']({ | {%- set slave = salt['grains.filter_by']({ | ||||
'default': { | |||||
'max_connections': 20000, | |||||
'innodb_buffer_pool_size': '3138M', | |||||
}, | |||||
'Debian': { | 'Debian': { | ||||
'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'], | 'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'], | ||||
'service': 'mysql', | 'service': 'mysql', | ||||
'socket': '/var/run/mysqld/mysqld.sock', | 'socket': '/var/run/mysqld/mysqld.sock', | ||||
'config': '/etc/mysql/my.cnf', | 'config': '/etc/mysql/my.cnf', | ||||
}, | }, | ||||
}, grain='oscodename', merge=pillar.galera.get('slave', {}))) %} | |||||
}, grain='oscodename', merge=pillar.galera.get('slave', {})), base='default') %} | |||||
{% set clustercheck = salt['grains.filter_by']({ | {% set clustercheck = salt['grains.filter_by']({ | ||||
'Debian': { | 'Debian': { | ||||
'port': '9200' | 'port': '9200' | ||||
}, | }, | ||||
}, merge=pillar.galera.get('clustercheck', {})) %} | }, merge=pillar.galera.get('clustercheck', {})) %} | ||||
{%- from "galera/map.jinja" import master with context %} | {%- from "galera/map.jinja" import master with context %} | ||||
{%- if master.enabled %} | |||||
{%- if master.get('enabled', False) %} | |||||
{%- if grains.os_family == 'RedHat' %} | {%- if grains.os_family == 'RedHat' %} | ||||
xtrabackup_repo: | xtrabackup_repo: |
{%- from "galera/map.jinja" import slave with context %} | {%- from "galera/map.jinja" import slave with context %} | ||||
{%- if slave.enabled %} | |||||
{%- if slave.get('enabled', False) %} | |||||
{%- if grains.os_family == 'RedHat' %} | {%- if grains.os_family == 'RedHat' %} | ||||
xtrabackup_repo: | xtrabackup_repo: |
galera_server_bind_address: ${_param:cluster_local_address} | galera_server_bind_address: ${_param:cluster_local_address} | ||||
galera_server_bind_port: 3306 | galera_server_bind_port: 3306 | ||||
galera_server_admin_user: root | galera_server_admin_user: root | ||||
galera_max_connections: 20000 | |||||
galera_innodb_buffer_pool_size: 3138M | |||||
galera: | galera: | ||||
master: | master: | ||||
enabled: true | enabled: true | ||||
port: 4567 | port: 4567 | ||||
- host: ${_param:cluster_node03_address} | - host: ${_param:cluster_node03_address} | ||||
port: 4567 | port: 4567 | ||||
max_connections: ${_param:galera_max_connections} | |||||
innodb_buffer_pool_size: ${_param:galera_innodb_buffer_pool_size} | |||||
mysql: | mysql: | ||||
server: | server: | ||||
users: | users: |
galera_server_cluster_name: galeracluster | galera_server_cluster_name: galeracluster | ||||
galera_server_bind_port: 3306 | galera_server_bind_port: 3306 | ||||
galera_server_admin_user: root | galera_server_admin_user: root | ||||
galera_max_connections: 20000 | |||||
galera_innodb_buffer_pool_size: 3138M | |||||
kubernetes: | kubernetes: | ||||
control: | control: | ||||
configmap: | configmap: | ||||
port: 4567 | port: 4567 | ||||
- host: ${_param:mysql_service_host03} | - host: ${_param:mysql_service_host03} | ||||
port: 4567 | port: 4567 | ||||
max_connections: ${_param:galera_max_connections} | |||||
innodb_buffer_pool_size: ${_param:galera_innodb_buffer_pool_size} | |||||
mysql: | mysql: | ||||
server: | server: | ||||
users: | users: |
galera_server_bind_address: ${_param:cluster_local_address} | galera_server_bind_address: ${_param:cluster_local_address} | ||||
galera_server_bind_port: 3306 | galera_server_bind_port: 3306 | ||||
galera_server_admin_user: root | galera_server_admin_user: root | ||||
galera_max_connections: 20000 | |||||
galera_innodb_buffer_pool_size: 3138M | |||||
galera: | galera: | ||||
slave: | slave: | ||||
enabled: true | enabled: true | ||||
port: 4567 | port: 4567 | ||||
- host: ${_param:cluster_node03_address} | - host: ${_param:cluster_node03_address} | ||||
port: 4567 | port: 4567 | ||||
max_connections: ${_param:galera_max_connections} | |||||
innodb_buffer_pool_size: ${_param:galera_innodb_buffer_pool_size} | |||||
mysql: | mysql: | ||||
server: | server: | ||||
users: | users: |
available_when_donor: 1 | available_when_donor: 1 | ||||
available_when_readonly: 1 | available_when_readonly: 1 | ||||
port: 9200 | port: 9200 | ||||
max_connections: 20000 | |||||
innodb_buffer_pool_size: 3138M | |||||
mysql: | mysql: | ||||
server: | server: | ||||
database: | database: |
available_when_donor: 1 | available_when_donor: 1 | ||||
available_when_readonly: 1 | available_when_readonly: 1 | ||||
port: 9200 | port: 9200 | ||||
max_connections: 20000 | |||||
innodb_buffer_pool_size: 3138M | |||||
mysql: | mysql: | ||||
server: | server: | ||||
users: | users: |