KnowHow

技術的なメモを中心にまとめます。
検索にて調べることができます。

管理ノードからslurm.confを配布するシェルのサンプル

登録日 :2024/03/18 05:24
カテゴリ :SLURM

管理ノードにてslurm.confを編集したら、すべてのクライアントに配布してslurmdデーモンの再起動が必要である。そのスクリプト例を以下に示す。

[root@manage slurm]# cat send-conf.sh

date
hostname

for n in node{1..2}
do
    printf "send config and restart slurm -> %s: " $n
    scp -p /etc/slurm/slurm.conf $n:/etc/slurm/
    #ssh $n systemctl enable slurmd
    ssh $n systemctl stop slurmd
    ssh $n systemctl start slurmd
    ssh $n systemctl status slurmd | grep Active | awk '{print $2 $3}'
done
    echo " "

systemctl stop slurmd
systemctl stop slurmctld

#systemctl enable slurmctld
#systemctl enable slurmd

systemctl start slurmctld
systemctl start slurmd

echo "slurmctld -> "
systemctl status slurmctld | grep Active | awk '{print $2 $3}'
echo "slurmd -> "
systemctl status slurmd | grep Active | awk '{print $2 $3}'