0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ノードを起動してもSLURMのsinfoがidleにならない時の対策

Posted at

問題

フロントシステムからsinfoコマンドを使ってSlurmの接続を確認し、idleではなくdownになっているときがある。電力料金事情もあって、計算ノードは普段電源OFFして、利用時のみWake On LANで立ち上げたい。となると、起動時は自動でidle状態になって欲しい。

何とかしよう。

当環境: CentOS7.9、SLURM 19.05.5

SLURMのインストール方法はこちら
https://qiita.com/pochman/items/1353fc0d93d0f1bd9989

当環境での原因

当環境では計算ノード起動時に、mungeサービスが上手く立ち上がっていないことが原因だった。mungeが起動に失敗するのは、サービスの起動順序が早すぎるため。サービス起動順序の依存関係を設定することで、解決できた。サービスの依存関係は/etc/systemd/system/multi-user.target.wants/の中のmunge.serviceに書き込む(実はシンボリックリンクだけど)。その中のUnit項目に、Afterから始まる次の行を追加

[Unit]
Description=MUNGE authentication service
...
After=network.target ypbind.service

すると、ypbindサービスが起動するまでmungeの起動を待つようになる。ちなみに、slurmdもmungeを待つようになっているはず。

計算ノード起動後に自動でscontrol update

計算ノードのrc.localscontrol updateコマンドを書きたいが、これも起動順序の関係で動かないことがある。そこで、システムの全てのサービス(default.target)が起動した後に実行するスクリプトとしてrc.local.lastestを作る。

vi /usr/lib/systemd/system/rc-local-lastest.service

#記述内容##########################
[Unit]
After=default.target

[Install]
WantedBy=default.target

[Service]
Type=forking
ExecStart=/etc/rc.local.lastest

これをサービスに登録

systemctl enable rc-local-lastest

これで、/etc/systemd/system/default.target.wants/にシンボリックリンクができていれば成功

次に、rc.local.lastestの中身は次のようにする。

vi /etc/rc.local.lastest
#中身
#!/bin/bash
#this script is expected to be performed after all default services
scontrol update nodename=hostname01 state=idle

また、実行権限も変更

chmod 755 /etc/rc.local.lastest

再起動してみる。
sinfoの情報がidleに設定された。

おわりに

誰かのお役に立てば幸いです。メリークリスマス!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?