Compare commits
9 Commits
e7d5cb1edb
...
1b75679496
Author | SHA1 | Date | |
---|---|---|---|
1b75679496 | |||
ebf4a4c2ac | |||
57a83cef26 | |||
8ee52143fc | |||
67a18c4f49 | |||
b8428e67a8 | |||
e18529e6e1 | |||
89db1449d1 | |||
6660a0cd36 |
@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# default is 128MB but is a waste because it seems only the mysql table uses it
|
# default is 128MB but is a waste because it seems only the mysql table uses it
|
||||||
key_buffer_size: 32M
|
key_buffer_size: 8M
|
||||||
|
|
||||||
# default is 128MB but is a waste because it seems only information_schema uses
|
# default is 128MB but is a waste because it seems only information_schema uses
|
||||||
# AriaDB, see: https://mariadb.com/kb/en/mariadb/aria-system-variables
|
# AriaDB, see: https://mariadb.com/kb/en/mariadb/aria-system-variables
|
||||||
@ -15,10 +15,6 @@ aria_pagecache_buffer_size: 8M
|
|||||||
# default is 128M, but set to at least the size of your InnoDB data
|
# default is 128M, but set to at least the size of your InnoDB data
|
||||||
innodb_buffer_pool_size: 256M
|
innodb_buffer_pool_size: 256M
|
||||||
|
|
||||||
# Unless you have a pool size over 1GB, use a single instance
|
|
||||||
# See: https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables
|
|
||||||
innodb_buffer_pool_instances: 1
|
|
||||||
|
|
||||||
# Ansible 2.7.x with PyMySQL seems to default to TCP connection so we should
|
# Ansible 2.7.x with PyMySQL seems to default to TCP connection so we should
|
||||||
# force it to use a Unix socket.
|
# force it to use a Unix socket.
|
||||||
# See: https://github.com/ansible/ansible/issues/47736
|
# See: https://github.com/ansible/ansible/issues/47736
|
||||||
@ -27,4 +23,12 @@ mariadb_login_unix_socket: /var/run/mysqld/mysqld.sock
|
|||||||
# default is 100 but the max I've seen used is 5, so let's reduce it
|
# default is 100 but the max I've seen used is 5, so let's reduce it
|
||||||
max_connections: 33
|
max_connections: 33
|
||||||
|
|
||||||
|
# disable the query cache by default
|
||||||
|
query_cache_size: 0
|
||||||
|
query_cache_type: 0
|
||||||
|
|
||||||
|
# mysqltuner says we should use larger than 32M on our setup
|
||||||
|
tmp_table_size: 64M
|
||||||
|
max_heap_table_size: 64M
|
||||||
|
|
||||||
# vim: set ts=2 sw=2:
|
# vim: set ts=2 sw=2:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: restart mysql
|
- name: restart mariadb
|
||||||
systemd: name=mysql state=restarted
|
systemd: name=mariadb state=restarted
|
||||||
|
|
||||||
# vim: set ts=2 sw=2:
|
# vim: set ts=2 sw=2:
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
---
|
---
|
||||||
- name: Add GPG key for MariaDB repo
|
- name: Add GPG key for MariaDB repo
|
||||||
apt_key: id=0x177F4010FE56CA3336300305F1656F24C74CD1D8 url=https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x177F4010FE56CA3336300305F1656F24C74CD1D8
|
apt_key: id=0x177F4010FE56CA3336300305F1656F24C74CD1D8 url=https://mariadb.org/mariadb_release_signing_key.asc
|
||||||
register: add_mariadb_apt_key
|
register: add_mariadb_apt_key
|
||||||
tags: mariadb, packages
|
tags: mariadb, packages
|
||||||
|
|
||||||
- name: Add MariaDB 10.4 repo
|
- name: Add MariaDB 10.5 repo
|
||||||
template: src=mariadb.list.j2 dest=/etc/apt/sources.list.d/mariadb.list owner=root group=root mode=0644
|
template: src=mariadb.list.j2 dest=/etc/apt/sources.list.d/mariadb.list owner=root group=root mode=0644
|
||||||
register: add_mariadb_apt_repository
|
register: add_mariadb_apt_repository
|
||||||
tags: mariadb, packages
|
tags: mariadb, packages
|
||||||
@ -26,7 +26,7 @@
|
|||||||
- name: Create system my.cnf
|
- name: Create system my.cnf
|
||||||
template: src=my.cnf.j2 dest=/etc/mysql/my.cnf owner=root group=root mode=0644
|
template: src=my.cnf.j2 dest=/etc/mysql/my.cnf owner=root group=root mode=0644
|
||||||
notify:
|
notify:
|
||||||
- restart mysql
|
- restart mariadb
|
||||||
tags: mariadb
|
tags: mariadb
|
||||||
|
|
||||||
# 'localhost' needs to be the last item for idempotency, see
|
# 'localhost' needs to be the last item for idempotency, see
|
||||||
@ -51,7 +51,7 @@
|
|||||||
tags: mariadb
|
tags: mariadb
|
||||||
|
|
||||||
- name: Create MariaDB user(s)
|
- name: Create MariaDB user(s)
|
||||||
mysql_user: name={{ item.user }} password={{ item.pass }} priv={{ item.name }}.*:ALL state=present
|
mysql_user: name={{ item.user }} password={{ item.pass }} priv={{ item.name }}.*:ALL host=127.0.0.1 state=present
|
||||||
loop: "{{ mariadb_databases }}"
|
loop: "{{ mariadb_databases }}"
|
||||||
when: mariadb_databases is defined
|
when: mariadb_databases is defined
|
||||||
tags: mariadb
|
tags: mariadb
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{{ ansible_managed | comment }}
|
{{ ansible_managed | comment }}
|
||||||
|
|
||||||
deb [arch=amd64] http://mirror.23media.de/mariadb/repo/10.4/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main
|
deb [arch=amd64] http://mirror.23media.de/mariadb/repo/10.5/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main
|
||||||
|
@ -47,6 +47,10 @@ skip-external-locking
|
|||||||
# Instead of skip-networking the default is now to listen only on
|
# Instead of skip-networking the default is now to listen only on
|
||||||
# localhost which is more compatible and is not less secure.
|
# localhost which is more compatible and is not less secure.
|
||||||
bind-address = 127.0.0.1
|
bind-address = 127.0.0.1
|
||||||
|
|
||||||
|
# don't resolve connection IPs to hostnames (make sure user accounts are using
|
||||||
|
# IPs instead of "localhost")
|
||||||
|
skip-name-resolve=1
|
||||||
#
|
#
|
||||||
# * Fine Tuning
|
# * Fine Tuning
|
||||||
#
|
#
|
||||||
@ -57,8 +61,8 @@ max_allowed_packet = 16M
|
|||||||
thread_cache_size = 128
|
thread_cache_size = 128
|
||||||
sort_buffer_size = 4M
|
sort_buffer_size = 4M
|
||||||
bulk_insert_buffer_size = 16M
|
bulk_insert_buffer_size = 16M
|
||||||
tmp_table_size = 32M
|
tmp_table_size = {{ tmp_table_size }}
|
||||||
max_heap_table_size = 32M
|
max_heap_table_size = {{ max_heap_table_size }}
|
||||||
#
|
#
|
||||||
# * MyISAM
|
# * MyISAM
|
||||||
#
|
#
|
||||||
@ -75,11 +79,9 @@ read_rnd_buffer_size = 1M
|
|||||||
#
|
#
|
||||||
# * Query Cache Configuration
|
# * Query Cache Configuration
|
||||||
#
|
#
|
||||||
# Cache only tiny result sets, so we can fit more in the query cache.
|
|
||||||
query_cache_limit = 128K
|
query_cache_limit = 128K
|
||||||
query_cache_size = 64M
|
query_cache_size = {{ query_cache_size }}
|
||||||
# for more write intensive setups, set to DEMAND or OFF
|
query_cache_type = {{ query_cache_type }}
|
||||||
#query_cache_type = DEMAND
|
|
||||||
#
|
#
|
||||||
# * Logging and Replication
|
# * Logging and Replication
|
||||||
#
|
#
|
||||||
@ -141,7 +143,6 @@ innodb_file_per_table = 1
|
|||||||
innodb_open_files = 400
|
innodb_open_files = 400
|
||||||
innodb_io_capacity = 400
|
innodb_io_capacity = 400
|
||||||
innodb_flush_method = O_DIRECT
|
innodb_flush_method = O_DIRECT
|
||||||
innodb_buffer_pool_instances = {{ innodb_buffer_pool_instances }}
|
|
||||||
|
|
||||||
aria_pagecache_buffer_size = {{ aria_pagecache_buffer_size }}
|
aria_pagecache_buffer_size = {{ aria_pagecache_buffer_size }}
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user