Browse Source

Merge "Add new soft parameters"

revert-bumpto57-2
Ales Komarek 7 years ago
parent
commit
7f1bbaa91e
10 changed files with 39 additions and 21 deletions
  1. +7
    -8
      README.rst
  2. +2
    -7
      galera/files/my.cnf
  3. +2
    -2
      galera/files/my.cnf.container
  4. +2
    -2
      galera/files/my.cnf.init
  5. +10
    -2
      galera/map.jinja
  6. +4
    -0
      metadata/service/master/cluster.yml
  7. +4
    -0
      metadata/service/master/container.yml
  8. +4
    -0
      metadata/service/slave/cluster.yml
  9. +2
    -0
      tests/pillar/master_cluster.sls
  10. +2
    -0
      tests/pillar/slave_cluster.sls

+ 7
- 8
README.rst View File

@@ -56,20 +56,19 @@ Galera cluster slave node
user: root
password: pass

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:

.. 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
=====

+ 2
- 7
galera/files/my.cnf View File

@@ -16,7 +16,7 @@ syslog
datadir=/var/lib/mysql
bind-address={{ service.bind.address }}
port=3306
max_connections={{ service.get('max_connections', 20000) }}
max_connections={{ service.max_connections }}
default-storage-engine=innodb
binlog_format=ROW
collation-server=utf8_general_ci
@@ -39,12 +39,7 @@ query_cache_type=0

innodb_file_format=Barracuda
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_read_io_threads=8
innodb_write_io_threads=8

+ 2
- 2
galera/files/my.cnf.container View File

@@ -12,7 +12,7 @@ socket=/var/lib/mysql/mysql.sock
pid_file=/var/lib/mysql/mysql.pid
port=3306
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_file_per_table=1
innodb_data_file_path = ibdata1:100M:autoextend
@@ -45,7 +45,7 @@ character-set-server=utf8
skip_name_resolve
memlock=0
sysdate_is_now=1
max_connections={{ service.get('max_connections', 20000) }}
max_connections={{ service.max_connections }}
thread_cache_size=512
query_cache_type = 0
query_cache_size = 0

+ 2
- 2
galera/files/my.cnf.init View File

@@ -15,7 +15,7 @@ syslog
datadir=/var/lib/mysql
bind-address={{ service.bind.address }}
port=3306
max_connections={{ service.get('max_connections', 20000) }}
max_connections={{ service.max_connections }}
default-storage-engine=innodb
binlog_format=ROW
collation-server=utf8_general_ci
@@ -36,7 +36,7 @@ query_cache_type=0

innodb_file_format=Barracuda
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_read_io_threads=8
innodb_write_io_threads=8

+ 10
- 2
galera/map.jinja View File

@@ -1,5 +1,9 @@

{%- set master = salt['grains.filter_by']({
'default': {
'max_connections': 20000,
'innodb_buffer_pool_size': '3138M',
},
'Debian': {
'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'],
'service': 'mysql',
@@ -17,9 +21,13 @@
'socket': '/var/run/mariadb/mysqld.sock',
'config': '/etc/my.cnf',
},
}, merge=pillar.galera.get('master', {})) %}
}, merge=pillar.galera.get('master', {}), base='default') %}

{%- set slave = salt['grains.filter_by']({
'default': {
'max_connections': 20000,
'innodb_buffer_pool_size': '3138M',
},
'Debian': {
'pkgs': ['mysql-wsrep-5.6', 'galera-3', 'rsync', 'python-mysqldb', 'libmysqlclient18', 'psmisc', 'netcat', 'percona-xtrabackup', 'socat', 'libdbd-mysql', 'python-pymysql'],
'service': 'mysql',
@@ -54,4 +62,4 @@
'socket': '/var/run/mysqld/mysqld.sock',
'config': '/etc/mysql/my.cnf',
},
}, grain='oscodename', merge=pillar.galera.get('slave', {}))) %}
}, grain='oscodename', merge=pillar.galera.get('slave', {})), base='default') %}

+ 4
- 0
metadata/service/master/cluster.yml View File

@@ -8,6 +8,8 @@ parameters:
galera_server_bind_address: ${_param:cluster_local_address}
galera_server_bind_port: 3306
galera_server_admin_user: root
galera_max_connections: 20000
galera_innodb_buffer_pool_size: 3138M
galera:
master:
enabled: true
@@ -26,6 +28,8 @@ parameters:
port: 4567
- host: ${_param:cluster_node03_address}
port: 4567
max_connections: ${_param:galera_max_connections}
innodb_buffer_pool_size: ${_param:galera_innodb_buffer_pool_size}
mysql:
server:
users:

+ 4
- 0
metadata/service/master/container.yml View File

@@ -3,6 +3,8 @@ parameters:
galera_server_cluster_name: galeracluster
galera_server_bind_port: 3306
galera_server_admin_user: root
galera_max_connections: 20000
galera_innodb_buffer_pool_size: 3138M
kubernetes:
control:
configmap:
@@ -28,6 +30,8 @@ parameters:
port: 4567
- host: ${_param:mysql_service_host03}
port: 4567
max_connections: ${_param:galera_max_connections}
innodb_buffer_pool_size: ${_param:galera_innodb_buffer_pool_size}
mysql:
server:
users:

+ 4
- 0
metadata/service/slave/cluster.yml View File

@@ -8,6 +8,8 @@ parameters:
galera_server_bind_address: ${_param:cluster_local_address}
galera_server_bind_port: 3306
galera_server_admin_user: root
galera_max_connections: 20000
galera_innodb_buffer_pool_size: 3138M
galera:
slave:
enabled: true
@@ -26,6 +28,8 @@ parameters:
port: 4567
- host: ${_param:cluster_node03_address}
port: 4567
max_connections: ${_param:galera_max_connections}
innodb_buffer_pool_size: ${_param:galera_innodb_buffer_pool_size}
mysql:
server:
users:

+ 2
- 0
tests/pillar/master_cluster.sls View File

@@ -16,6 +16,8 @@
port: 4567
- host: 127.0.0.1
port: 4567
max_connections: 20000
innodb_buffer_pool_size: 3138M
mysql:
server:
users:

+ 2
- 0
tests/pillar/slave_cluster.sls View File

@@ -16,6 +16,8 @@
port: 4567
- host: 127.0.0.1
port: 4567
max_connections: 20000
innodb_buffer_pool_size: 3138M
mysql:
server:
users:

Loading…
Cancel
Save