#
d. Configure SLURM
On the login node:
Open the file
/opt/flight/opt/slurm/etc/slurm.conf
and add this information:ControlMachine=chead1 SlurmUser=nobody SlurmctldPort=6827 SlurmdPort=6828 AuthType=auth/munge StateSaveLocation=/opt/flight/opt/slurm/var/spool/slurm.state SlurmdSpoolDir=/opt/flight/opt/slurm/var/spool/slurmd.spool SwitchType=switch/none MpiDefault=none SlurmctldPidFile=/opt/flight/opt/slurm/var/run/slurmctld.pid ClusterName=mycluster1 SlurmdPidFile=/opt/flight/opt/slurm/var/run/slurmd.pid ProctrackType=proctrack/pgid ReturnToService=2 SlurmctldTimeout=300 SlurmdTimeout=300 InactiveLimit=0 MinJobAge=300 KillWait=30 Waittime=0 SchedulerType=sched/backfill SelectType=select/cons_res SelectTypeParameters=CR_CORE_Memory SlurmctldDebug=3 SlurmctldLogFile=/opt/flight/opt/slurm/var/log/slurmctld.log SlurmdDebug=3 SlurmdLogFile=/opt/flight/opt/slurm/var/log/slurmd.log JobCompType=jobcomp/none NodeName=cnode[01-02] PartitionName=all Nodes=ALL Default=YES MaxTime=UNLIMITED
Create directories for SLURM.
mkdir -p /opt/flight/opt/slurm/var/{log,run,spool/slurm.state}
Set the owner of the directories.
chown -R nobody: /opt/flight/opt/slurm/var/{log,run,spool}
Generate a random 64 digit alphanumeric string to be used as a munge key.
tr -dc A-Za-z0-9 </dev/urandom | head -c 64 ; echo ''
Copy the 64 digit code from the terminal, navigate to the file
/etc/munge/munge.key
, then paste it in.Set the owner of the munge key.
chown munge: /etc/munge/munge.key
Set permissions on the munge key.
chmod 400 /etc/munge/munge.key
Start and enable munge and SLURM.
systemctl start munge systemctl enable munge systemctl start flight-slurmctld systemctl enable flight-slurmctld
Now the SLURM server has been set up, the SLURM clients need to be set up on the other nodes.
On a compute node:
Take the contents of the file
/opt/flight/opt/slurm/etc/slurm.conf
on the head node and copy it to the same location on the current node.Create new directories for SLURM:
mkdir -p /opt/flight/opt/slurm/var/{log,run,spool}
Set the owner of the new directories:
chown -R nobody: /opt/flight/opt/slurm/var/{log,run,spool}
Take the munge key from the file
/etc/munge/munge.key
on the head node and make a munge key in the same location on the current node.Set the owner of the munge key:
chown munge: /etc/munge/munge.key
Set permissions on the munge key.
chmod 400 /etc/munge/munge.key
Start munge and SLURM:
systemctl start munge systemctl enable munge systemctl start flight-slurmd systemctl enable flight-slurmd
Repeat these steps on every other compute node.