Installing the Slurm Accounting Database
This section describes how to install configure the Slurm accounting database for license checking. For more information about the Slurm accounting database, see https://slurm.schedmd.com/accounting.html.
The configuration described below has the following requirements:
- the Slurm database daemon
slurmdbd
and the SQL database server are running on the same instance; - the user account
slurm
already exists in the operating system and can be used to run the Slurm daemons; and - firewalls are configured to allow traffic between the license server, the Slurm accounting database, the license sensor, and the compute cluster (both the master node and the compute nodes).
A single Slurm accounting database can manage multiple Slurm clusters. Therefore, the steps below only have to be performed once.
Installing The MariaDB SQL Server
We recommend MariaDB as SQL database. Prebuilt packages are available in the repositories for all supported Linux distributions and can be installed using the distribution's package manager. If you want to build Slurm from source, you also need to install the development packages for MariaDB. For more information regarding building Slurm from source, see: https://slurm.schedmd.com/quickstart_admin.html
Install the following dependencies with your distribution’s package manager:
- RedHat Enterprise Linux, CentOS, or Ubuntu:
mariadb-server
- SuSE Linux Enterprise Server:
mariadb
andmariadb-tools
Starting The MariaDB SQL Server
-
Create a configuration file (
/etc/my.cnf.d/slurm.cnf
) with the following content:[mysqld] innodb_buffer_pool_size=1024M innodb_log_file_size=64M innodb_lock_wait_timeout=900
-
Start the MariaDB server and enable its startup when the system boots:
systemctl enable mariadb systemctl start mariadb
-
Confirm that mariadb is running:
systemctl status mariadb
Creating The Database
Execute the following command to create an SQL database:
mysql -u root << EOF CREATE DATABASE slurm_acct_db; GRANT ALL ON slurm_acct_db.* to 'slurm'@'localhost' IDENTIFIED BY 'SQL_PASSWORD' WITH GRANT OPTION; FLUSH PRIVILEGES; EOF
This creates the database slurm_acct_db
and grants non-privileged access to the user slurm
, which is the user account on the operating system that operates all Slurm processes. Replace SQL_PASSWORD
with a password you want to use for connecting to this database. The single quotes around the password are required by SQL and are not part of the password.