Skip to content
Snippets Groups Projects
Commit fb2e7aeb authored by Giancarlo Razzolini's avatar Giancarlo Razzolini Committed by Sven-Hendrik Haase
Browse files

roles/mariadb: Set the nocow attribute when using btrfs

To improve mysql performance when using btrfs, set the nocow attribute
before running initdb, so all the files created under the mysql datadir have
the attribute.
parent 48a99ad5
Branches mariadb-nocow
No related tags found
No related merge requests found
---
mariadb_data_dir: '/var/lib/mysql'
mariadb_skip_name_resolve: False
mariadb_skip_networking: True
......
......@@ -2,10 +2,17 @@
- name: install mariadb
pacman: name=mariadb,python-mysqlclient state=present
- name: set the nocow attribute for btrfs
file:
path: "{{ mariadb_data_dir }}"
state: directory
attributes: '+C'
when: filesystem == 'btrfs'
- name: initialize mariadb
command: mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
command: mysql_install_db --user=mysql --basedir=/usr --datadir="{{ mariadb_data_dir }}"
args:
creates: /var/lib/mysql/mysql
creates: "{{ mariadb_data_dir }}/mysql"
- name: configure mariadb
template: src=server.cnf.j2 dest=/etc/my.cnf.d/server.cnf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment