Compare commits

..

No commits in common. "1b756794968a21dffde5b2699077d6e0626459a5" and "e7d5cb1edbc2acdc5a274d335b4bb66cb9f4a497" have entirely different histories.

5 changed files with 19 additions and 24 deletions

View File

@ -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: 8M key_buffer_size: 32M
# 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,6 +15,10 @@ 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
@ -23,12 +27,4 @@ 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:

View File

@ -1,5 +1,5 @@
--- ---
- name: restart mariadb - name: restart mysql
systemd: name=mariadb state=restarted systemd: name=mysql state=restarted
# vim: set ts=2 sw=2: # vim: set ts=2 sw=2:

View File

@ -1,10 +1,10 @@
--- ---
- name: Add GPG key for MariaDB repo - name: Add GPG key for MariaDB repo
apt_key: id=0x177F4010FE56CA3336300305F1656F24C74CD1D8 url=https://mariadb.org/mariadb_release_signing_key.asc apt_key: id=0x177F4010FE56CA3336300305F1656F24C74CD1D8 url=https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x177F4010FE56CA3336300305F1656F24C74CD1D8
register: add_mariadb_apt_key register: add_mariadb_apt_key
tags: mariadb, packages tags: mariadb, packages
- name: Add MariaDB 10.5 repo - name: Add MariaDB 10.4 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 mariadb - restart mysql
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 host=127.0.0.1 state=present mysql_user: name={{ item.user }} password={{ item.pass }} priv={{ item.name }}.*:ALL state=present
loop: "{{ mariadb_databases }}" loop: "{{ mariadb_databases }}"
when: mariadb_databases is defined when: mariadb_databases is defined
tags: mariadb tags: mariadb

View File

@ -1,3 +1,3 @@
{{ ansible_managed | comment }} {{ ansible_managed | comment }}
deb [arch=amd64] http://mirror.23media.de/mariadb/repo/10.5/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main deb [arch=amd64] http://mirror.23media.de/mariadb/repo/10.4/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main

View File

@ -47,10 +47,6 @@ 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
# #
@ -61,8 +57,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 = {{ tmp_table_size }} tmp_table_size = 32M
max_heap_table_size = {{ max_heap_table_size }} max_heap_table_size = 32M
# #
# * MyISAM # * MyISAM
# #
@ -79,9 +75,11 @@ 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 = {{ query_cache_size }} query_cache_size = 64M
query_cache_type = {{ query_cache_type }} # for more write intensive setups, set to DEMAND or OFF
#query_cache_type = DEMAND
# #
# * Logging and Replication # * Logging and Replication
# #
@ -143,6 +141,7 @@ 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 }}
# #