Merge pull request 'refs #8414 - Add config files for test-db' (!54) from 8414_MariaDB_test_DB into main

Reviewed-on: #54
Reviewed-by: Juan Ferrer <juan@verdnatura.es>
This commit is contained in:
Xavi Lleó 2025-01-22 13:10:05 +00:00
commit bb9fb438ee
6 changed files with 93 additions and 45 deletions

View File

@ -6,7 +6,7 @@ lc_time_names = es_ES
character-set-server = utf8
collation-server = utf8_unicode_ci
explicit_defaults_for_timestamp = ON
datadir = /var/lib/mysql
datadir = /mnt/mysqldata/mysql
tmpdir = /mnt/mysqltmp
log_bin_trust_function_creators = 1
sql_mode = NO_ENGINE_SUBSTITUTION
@ -42,30 +42,11 @@ max_connect_errors = 50
#++++++++++++++++++++++++++++++++++++++++ Binary log
log-bin = /mnt/mysqlbin/binlog/bin.log
max_binlog_size = 1GB
binlog_cache_size = 16M
binlog_stmt_cache_size = 16M
binlog_row_image = noblob
binlog_format = row
relay_log = /mnt/mysqlbin/binlog/relay.log
binlog-ignore-db = tmp
binlog-ignore-db = PERCONA_SCHEMA
#++++++++++++++++++++++++++++++++++++++++ Replication
event-scheduler = ON
slave_exec_mode = STRICT
replicate-ignore-db = tmp
replicate-ignore-table = util.eventLog
replicate-ignore-table = cache.cache_calc
replicate-ignore-table = cache.available
replicate-ignore-table = cache.availableNoRaids
replicate-ignore-table = cache.cache_valid
replicate-ignore-table = cache.stock
replicate-ignore-table = cache.visible
#++++++++++++++++++++++++++++++++++++++++ InnoDB
@ -80,7 +61,6 @@ innodb_checksum_algorithm = crc32
innodb_adaptive_hash_index = 0
innodb_flush_method = O_DIRECT
innodb_log_buffer_size = 32M
innodb_log_file_size = 8G
innodb_purge_threads = 4
innodb_buffer_pool_dump_at_shutdown = ON
innodb_buffer_pool_load_at_startup = ON
@ -88,7 +68,6 @@ innodb_buffer_pool_load_at_startup = ON
#++++++++++++++++++++++++++++++++++++++++ Logging
log_error = /var/log/mysql/error.log
log_warnings = 1
log_output = TABLE
general_log = OFF
slow_query_log = ON

View File

@ -0,0 +1,14 @@
[mysqld]
port = 3307
bind-address = 0.0.0.0
innodb_buffer_pool_size = 18G
event-scheduler = OFF
innodb_log_file_size = 5G
log_warnings = 2
#++++++++++++++++++++++++++++++++++++++++ Binary log
log-bin = bin.log
expire_logs_days = 1
relay_log = mysqld-relay-bin

View File

@ -0,0 +1,29 @@
[mysqld]
port = 3306
innodb_log_file_size = 8G
log_warnings = 1
#++++++++++++++++++++++++++++++++++++++++ Binary log
log-bin = /mnt/mysqlbin/binlog/bin.log
max_connections = 1000
expire_logs_days = 7
innodb_buffer_pool_size = 64G
relay_log = /mnt/mysqlbin/binlog/relay.log
binlog-ignore-db = tmp
binlog-ignore-db = PERCONA_SCHEMA
#++++++++++++++++++++++++++++++++++++++++ Replication
event-scheduler = ON
slave_exec_mode = STRICT
replicate-ignore-db = tmp
replicate-ignore-table = util.eventLog
replicate-ignore-table = cache.cache_calc
replicate-ignore-table = cache.available
replicate-ignore-table = cache.availableNoRaids
replicate-ignore-table = cache.cache_valid
replicate-ignore-table = cache.stock
replicate-ignore-table = cache.visible

View File

@ -1,6 +0,0 @@
[mysqld]
port = 3306
max_connections = 1000
expire_logs_days = 7
innodb_buffer_pool_size = 64G

View File

@ -88,22 +88,54 @@
group: mysql
mode: u=rw,g=,o=
- name: Set MariaDB custom configuration
copy:
src: "{{ item }}"
- when: production is true
block:
- name: Set MariaDB custom configuration Production
copy:
src: "{{ item }}"
dest: /etc/mysql/mariadb.conf.d/
owner: root
group: root
mode: u=rw,g=r,o=r
with_items:
- "files/mariaconfigfiles/z90-vn.cnf"
- "files/mariaconfigfiles/z95-production"
notify: restart-mariadb
- name: Reminder to check mount points
debug:
msg: |
Remember to check the following mount points:
- /var/lib/mysql
- /mnt/mysqlbin
- /mnt/local-backup
Make sure they are correctly configured and accessible.
- when: testdb is true
block:
- name: Set MariaDB custom configuration Test
copy:
src: "{{ item }}"
dest: /etc/mysql/mariadb.conf.d/
owner: root
group: root
mode: u=rw,g=r,o=r
with_items:
- "files/mariaconfigfiles/z90-vn.cnf"
- "files/mariaconfigfiles/z92-testing.cnf"
notify: restart-mariadb
- name: Reminder to check mount points
debug:
msg: |
Remember to check the following mount points:
- /mnt/mysqltmp
Make sure they are correctly configured and accessible.
- name: Set MariaDB local configuration file
template:
src: templates/z99-local.cnf
dest: /etc/mysql/mariadb.conf.d/
owner: root
group: root
mode: u=rw,g=r,o=r
with_fileglob:
- "files/z9*.cnf"
notify: restart-mariadb
- name: Reminder to check mount points
debug:
msg: |
Remember to check the following mount points:
- /var/lib/mysql
- /mnt/mysqlbin
- /mnt/local-backup
Make sure they are correctly configured and accessible.
mode: u=rw,g=r,o=r

View File

@ -1,6 +1,6 @@
[mysqld]
server-id = 1
server-id = {{ serverid }}
#bind-address = 127.0.0.1
#event-scheduler = OFF
#skip-log-bin