Skip to content
Snippets Groups Projects
Commit 2f14d1e9 authored by Simon Michnowicz's avatar Simon Michnowicz
Browse files

first checkin

parent fe6e947e
No related branches found
No related tags found
1 merge request!595Slurm upgrade and new rocky sql server
# 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'
'''
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