my.cnf.j2 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [mysqld]
  2. datadir=/var/lib/mysql
  3. # Disabling symbolic-links is recommended to prevent assorted security risks
  4. symbolic-links=0
  5. # Settings user and group are ignored when systemd is used.
  6. # If you need to run mysqld under a different user or group,
  7. # customize your systemd unit file for mariadb according to the
  8. # instructions in http://fedoraproject.org/wiki/Systemd
  9. # skip domain name resolve
  10. skip_name_resolve
  11. # auto delete binlog older than 30 days
  12. expire_logs_days=30
  13. innodb_file_per_table=ON
  14. max_connections = 300
  15. max_allowed_packet=20M
  16. group_concat_max_len=20M
  17. default_time_zone='+00:00'
  18. {% if inventory_hostname == groups['mariadb_ha_nodes'][0] %}
  19. server-id = 1
  20. auto_increment_offset = 1
  21. {% else %}
  22. server-id = 2
  23. auto_increment_offset = 2
  24. {% endif %}
  25. auto_increment_increment = 2
  26. log-bin = mysql-bin
  27. binlog-format = row
  28. log-slave-updates
  29. max_binlog_size = 1G
  30. replicate-ignore-db = information_schema
  31. replicate-ignore-db = performance_schema
  32. max_connections = 1000
  33. max_connect_errors = 0
  34. max_allowed_packet = 1G
  35. group_concat_max_len = 1G
  36. slave-net-timeout=10
  37. master-retry-count=0
  38. slow_query_log = 1
  39. long_query_time = 2
  40. slow_query_log_file = /var/log/mariadb/slow-query.log
  41. [mysql]
  42. no-auto-rehash
  43. [mysqld_safe]
  44. log-error=/var/log/mariadb/mariadb.log
  45. pid-file=/var/run/mariadb/mariadb.pid
  46. # include all files from the config directory
  47. !includedir /etc/my.cnf.d