feat(delivery): add Ansible playbook for native MySQL provisioning
Add mysql-deploy.yml playbook for bare-metal MySQL 8.0 delivery via AWX: parameter validation, resource preflight checks, apt install, AppArmor adaptation, per-instance directory layout, Jinja2 config template (buffer pool sizing, binlog, GTID), systemd template unit (mysql-delivery@.service), admin account setup, and TCP health verification. Includes example inventory. Relates-to: #97
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
[mysqld]
|
||||
user=mysql
|
||||
basedir=/usr
|
||||
datadir={{ mysql_data_dir }}
|
||||
socket={{ mysql_run_dir }}/mysql.sock
|
||||
pid-file={{ mysql_run_dir }}/mysql.pid
|
||||
port={{ mysql_port_value }}
|
||||
bind-address=0.0.0.0
|
||||
mysqlx=0
|
||||
server-id={{ 101 + mysql_node_index | int }}
|
||||
log-error={{ mysql_log_dir }}/error.log
|
||||
slow-query-log=ON
|
||||
slow-query-log-file={{ mysql_log_dir }}/slow.log
|
||||
skip-name-resolve=ON
|
||||
max-connections=100
|
||||
innodb-buffer-pool-size={{ ((mysql_memory_mb_value | int) * 55 / 100) | int }}M
|
||||
innodb-log-file-size=128M
|
||||
log-bin={{ mysql_log_dir }}/mysql-bin
|
||||
binlog-format=ROW
|
||||
gtid-mode=ON
|
||||
enforce-gtid-consistency=ON
|
||||
relay-log={{ mysql_log_dir }}/relay-bin
|
||||
|
||||
{% if topology == 'mgr_3' %}
|
||||
plugin-load-add=group_replication.so
|
||||
transaction-write-set-extraction=XXHASH64
|
||||
loose-group-replication-group-name={{ mgr_group_name }}
|
||||
loose-group-replication-start-on-boot=OFF
|
||||
loose-group-replication-local-address={{ ansible_host | default(inventory_hostname) }}:{{ mysql_port_value | int + 10000 }}
|
||||
loose-group-replication-group-seeds={% for host in ansible_play_hosts_all %}{{ hostvars[host].ansible_host | default(host) }}:{{ mysql_port_value | int + 10000 }}{% if not loop.last %},{% endif %}{% endfor %}
|
||||
loose-group-replication-ip-allowlist={% for host in ansible_play_hosts_all %}{{ hostvars[host].ansible_host | default(host) }}{% if not loop.last %},{% endif %}{% endfor %}
|
||||
loose-group-replication-single-primary-mode=ON
|
||||
loose-group-replication-enforce-update-everywhere-checks=OFF
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user