diff --git a/defaults/main.yml b/defaults/main.yml index 7e6afcd..47415d4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -48,14 +48,10 @@ mysql_max_connections: 151 # Other settings. mysql_wait_timeout: 28800 -# Try number of CPU's * 2 for thread_concurrency. -mysql_thread_concurrency: 2 - # InnoDB settings. # Set .._buffer_pool_size up to 80% of RAM but beware of setting too high. mysql_innodb_file_per_table: "1" mysql_innodb_buffer_pool_size: "256M" -mysql_innodb_additional_mem_pool_size: "20M" # Set .._log_file_size to 25% of buffer pool size. mysql_innodb_log_file_size: "64M" mysql_innodb_log_buffer_size: "8M" diff --git a/tasks/configure.yml b/tasks/configure.yml index bef598a..aa5018d 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -42,6 +42,19 @@ mode: 0644 when: mysql_slow_query_log_enabled +- name: Create error log file (if configured). + shell: "touch {{ mysql_log_error }} creates={{ mysql_log_error }}" + when: mysql_log == "" and mysql_log_error != "" + +- name: Set ownership on error log file (if configured). + file: + path: "{{ mysql_log_error }}" + state: file + owner: mysql + group: mysql + mode: 0644 + when: mysql_slow_query_log_enabled + - name: Ensure MySQL is started and enabled on boot. service: "name={{ mysql_daemon }} state=started enabled={{ mysql_enabled_on_startup }}" register: mysql_service_configuration diff --git a/templates/my.cnf.j2 b/templates/my.cnf.j2 index 054f958..b13c3cb 100644 --- a/templates/my.cnf.j2 +++ b/templates/my.cnf.j2 @@ -78,13 +78,9 @@ max_connections = {{ mysql_max_connections }} # Other settings. wait_timeout = {{ mysql_wait_timeout }} -# Try number of CPU's * 2 for thread_concurrency. -thread_concurrency = {{ mysql_thread_concurrency }} - # InnoDB settings. innodb_file_per_table = {{ mysql_innodb_file_per_table }} innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }} -innodb_additional_mem_pool_size = {{ mysql_innodb_additional_mem_pool_size }} innodb_log_file_size = {{ mysql_innodb_log_file_size }} innodb_log_buffer_size = {{ mysql_innodb_log_buffer_size }} innodb_flush_log_at_trx_commit = {{ mysql_innodb_flush_log_at_trx_commit }}