diff --git a/roles/mysql/README.md b/roles/mysql/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4dbcba5955d6c94a1248fc7e83cb7b1b6d459e82 --- /dev/null +++ b/roles/mysql/README.md @@ -0,0 +1,63 @@ +# MYSQL FOR SLURM + +The Mysql for slurm is problematic, as configuring the database is no longer simple. +Ansible commands such as mysql_user do not work in a brand new system, as it appears +mysql/maria db must run in a root shell and Ansible breaks at this point. + +The preferred approach. + +1) Run this role. It may/may not break when trying to modify the database as the root password is not set. +2) Login to sql machine. sudo as root +3) Run /usr/bin/mysql_secure_installation Set the root password to what is found in our Ansible scripts, i.e. + ansible-vault edit vars/passwords.yml + Key to change is "sqlrootPasswd" +4). The datbase by default is in /var/lib which is on a small Unix disk partition. You need to change it. + Several options exist. + a) Set up a soft pointer, i.e. /var/lib/mysql -> /vdb/mysql OR + b) Modify /etc/my.cnf.d/mariadb-server.cnf and point to a new location + i.e. +''' +[mysqld] +datadir=/mnt/vdb1/var_lib_mysql +socket=/mnt/vdb1/var_lib_mysql/mysql.sock +log-error=/var/log/mariadb/mariadb.log +pid-file=/run/mariadb/mariadb.pid +''' + +5) The procures will be something like this: +a) systemctl stop mariadb +b) mkdir /mnt/vdb1/var_lib_mysql +c) chown mysql:mysql /mnt/vdb1/var_lib_mysql +d) cp -rp /var/lib/mysql/* /mnt/vdb1/var_lib_mysql +e) systemctl start mariadb +f) Use `systemctl status mariadb` and view `/var/log/mariadb/mariadb.log` to trace errors + +6) None of the above is in the ansible scripts. The `sql` role is tagged as **never** due to these complications +7) The access mechanisms to this role have been modified, so users can hardcode the SLURM controllers directly. + +Sample usage +''' +- role: mysql + vars: + mysql_type: "mysql_server" + mysql_root_password: "{{ sqlrootPasswd }}" + mysql_user_name: "slurmdb" + mysql_user_db_name: "slurm_acct_db" + current_slurm_mgmt_nodes_fqdn: " {{ current_slurm_mgmt_nodes_fqdn }} " + current_slurm_mgmt_nodes_short: " {{ current_slurm_mgmt_nodes_short }} " + mysql_user_password: "{{ slurmdb_passwd }}" + tags: [ database, mysql, never ] +''' + +where + +''' +- set_fact: + current_slurm_mgmt_nodes_fqdn: + - 'm3-mgmt3.massive.org.au' + - 'm3-mgmt4.massive.org.au' + current_slurm_mgmt_nodes_short: + - 'm3-mgmt3' + - 'm3-mgmt4' +''' +