play & role for mysql server

This commit is contained in:
2026-08-13 19:29:56 +02:00
parent 02e43dca13
commit 73cd52f7ef
7 changed files with 267 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/var/log/mysql/*.log {
daily
rotate 14
missingok
compress
delaycompress
notifempty
create 640 mysql adm
sharedscripts
postrotate
/usr/bin/mysqladmin flush-logs
endscript
}
+35
View File
@@ -0,0 +1,35 @@
# Production MySQL config — generated by Ansible for retailor.io. Edit by hand might cause drift!
[mysqld]
bind-address = {{ mysql_bind_address }}
port = {{ mysql_port }}
max_connections = {{ mysql_max_connections }}
server_id = {{ mysql_server_id }}
# --- InnoDB ------------------------------------------------------------
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 1 # full ACID durability; set to 2 only if you accept losing ~1s of txns on crash
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
# --- Replication (GTID-based) -------------------------------------------
gtid_mode = {{ mysql_gtid_mode }}
enforce_gtid_consistency = ON
log_bin = /var/log/mysql/mysql-bin.log
binlog_format = {{ mysql_binlog_format }}
binlog_expire_logs_seconds = {{ mysql_binlog_expire_logs_seconds }}
sync_binlog = 1
read_only = {{ 'ON' if 'mysql_replica' in group_names else 'OFF' }}
relay_log = /var/log/mysql/mysql-relay-bin
# --- Logging -------------------------------------------------------------
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 2
log_error = /var/log/mysql/error.log
# --- Security --------------------------------------------------------------
local_infile = 0
skip_name_resolve = 1
+4
View File
@@ -0,0 +1,4 @@
[client]
user = root
password = "{{ mysql_root_password }}"