Difference between revisions of "Slurm Install"
From CMU ITSC Network
(Created page with "== การติดตั้ง ==") |
|||
| Line 1: | Line 1: | ||
== การติดตั้ง == | == การติดตั้ง == | ||
| + | ทรัพยากรที่ใช้ในการติดตั้ง ประกอบไปด้วยเครื่องทั้งหมด 3 เครื่องโดยให้เครื่องแรกเป็น Headnode จะลง slurmctld, slurmdbd, slurmd ส่วนเครื่องที่เหลือเป็นเครื่อง computenode ลงแค่ตัว slurmd ทั้งหมดเป็น CentOS7 | ||
| + | {| class="wikitable" | ||
| + | |+ | ||
| + | !Hostname | ||
| + | !ip address | ||
| + | |- | ||
| + | |slurm-test-01 | ||
| + | |10.98.6.51 | ||
| + | |- | ||
| + | |slurm-test-02 | ||
| + | |10.98.6.52 | ||
| + | |- | ||
| + | |slurm-test-03 | ||
| + | |10.98.6.53 | ||
| + | |} | ||
| + | แนะนำให้ Login ด้วย Root ในการติดตั้ง เพราะบางคำสั่งจะติด Permission | ||
| + | |||
| + | เปลี่ยน Hostname และเพิ่ม Hosts<syntaxhighlight lang="linux-config"> | ||
| + | hostnamectl set-hostname slurm-test-01 | ||
| + | |||
| + | </syntaxhighlight>เพิ่ม ip ลงในบรรทัดสุดท้าย<syntaxhighlight lang="linux-config"> | ||
| + | vi /etc/hosts | ||
| + | |||
| + | .. | ||
| + | .. | ||
| + | 10.98.6.51 slurm-test01 | ||
| + | </syntaxhighlight>Restart network แล้ว Login ใหม่<syntaxhighlight lang="linux-config"> | ||
| + | sudo systemctl restart network | ||
| + | hostnamectl status | ||
| + | exit | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====== สร้าง Global users ให้กับทุก Node ====== | ||
| + | <syntaxhighlight lang="linux-config"> | ||
| + | export MUNGEUSER=991 | ||
| + | groupadd -g $MUNGEUSER munge | ||
| + | useradd -m -c "MUNGE Uid 'N' Gid Emporium" -d /var/lib/munge -u $MUNGEUSER -g munge -s /sbin/nologin munge | ||
| + | export SLURMUSER=992 | ||
| + | groupadd -g $SLURMUSER slurm | ||
| + | useradd -m -c "SLURM workload manager" -d /var/lib/slurm -u $SLURMUSER -g slurm -s /bin/bash slurm | ||
| + | </syntaxhighlight>ตรวจสอบว่าสร้าง user แล้ว<syntaxhighlight lang="linux-config"> | ||
| + | cat /etc/group | grep -e munge -e slurm | ||
| + | และ | ||
| + | cat /etc/passwd | grep -e munge -e slurm | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====== ติดตั้ง Munge ====== | ||
| + | Install REPL repository<syntaxhighlight lang="linux-config"> | ||
| + | yum install epel-release -y | ||
| + | </syntaxhighlight>Install Munge<syntaxhighlight lang="linux-config"> | ||
| + | yum install munge munge-libs munge-devel -y | ||
| + | </syntaxhighlight>สร้าง Secret key จากเครื่อง Headnode<syntaxhighlight lang="linux-config"> | ||
| + | dd if=/dev/urandom bs=1 count=1024 > /etc/munge/munge.key | ||
| + | chown munge: /etc/munge/munge.key | ||
| + | chmod 400 /etc/munge/munge.key | ||
| + | </syntaxhighlight>ก็อป key ไปยังเครื่องที่เหลือ<syntaxhighlight lang="linux-config"> | ||
| + | scp /etc/munge/munge.key root@10.98.6.52:/etc/munge/munge.key | ||
| + | scp /etc/munge/munge.key root@10.98.6.53:/etc/munge/munge.key | ||
| + | </syntaxhighlight>SSH ไปยังทุก Node เปลี่ยน Permission แล้วเริ่ม Munge service<syntaxhighlight lang="linux-config"> | ||
| + | chown -R munge: /etc/munge/ /var/log/munge/ | ||
| + | chmod 0700 /etc/munge/ /var/log/munge/ | ||
| + | </syntaxhighlight><syntaxhighlight lang="linux-config"> | ||
| + | systemctl enable munge | ||
| + | systemctl start munge | ||
| + | </syntaxhighlight>ทดสอบ Munge ว่าติดต่อไปยังเครื่องอื่นได้หรือไม่ โดยเข้าจาก Headnode<syntaxhighlight lang="linux-config"> | ||
| + | munge -n | ||
| + | munge -n | munge | ||
| + | munge -n | ssh 10.98.6.52 unmunge | ||
| + | remunge | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | ====== ติดตั้ง Slurm ====== | ||
Revision as of 09:30, 26 November 2021
การติดตั้ง
ทรัพยากรที่ใช้ในการติดตั้ง ประกอบไปด้วยเครื่องทั้งหมด 3 เครื่องโดยให้เครื่องแรกเป็น Headnode จะลง slurmctld, slurmdbd, slurmd ส่วนเครื่องที่เหลือเป็นเครื่อง computenode ลงแค่ตัว slurmd ทั้งหมดเป็น CentOS7
| Hostname | ip address |
|---|---|
| slurm-test-01 | 10.98.6.51 |
| slurm-test-02 | 10.98.6.52 |
| slurm-test-03 | 10.98.6.53 |
แนะนำให้ Login ด้วย Root ในการติดตั้ง เพราะบางคำสั่งจะติด Permission
เปลี่ยน Hostname และเพิ่ม Hosts
hostnamectl set-hostname slurm-test-01
เพิ่ม ip ลงในบรรทัดสุดท้าย
vi /etc/hosts
..
..
10.98.6.51 slurm-test01
Restart network แล้ว Login ใหม่
sudo systemctl restart network
hostnamectl status
exit
สร้าง Global users ให้กับทุก Node
export MUNGEUSER=991
groupadd -g $MUNGEUSER munge
useradd -m -c "MUNGE Uid 'N' Gid Emporium" -d /var/lib/munge -u $MUNGEUSER -g munge -s /sbin/nologin munge
export SLURMUSER=992
groupadd -g $SLURMUSER slurm
useradd -m -c "SLURM workload manager" -d /var/lib/slurm -u $SLURMUSER -g slurm -s /bin/bash slurm
ตรวจสอบว่าสร้าง user แล้ว
cat /etc/group | grep -e munge -e slurm
และ
cat /etc/passwd | grep -e munge -e slurm
ติดตั้ง Munge
Install REPL repository
yum install epel-release -y
Install Munge
yum install munge munge-libs munge-devel -y
สร้าง Secret key จากเครื่อง Headnode
dd if=/dev/urandom bs=1 count=1024 > /etc/munge/munge.key
chown munge: /etc/munge/munge.key
chmod 400 /etc/munge/munge.key
ก็อป key ไปยังเครื่องที่เหลือ
scp /etc/munge/munge.key root@10.98.6.52:/etc/munge/munge.key
scp /etc/munge/munge.key root@10.98.6.53:/etc/munge/munge.key
SSH ไปยังทุก Node เปลี่ยน Permission แล้วเริ่ม Munge service
chown -R munge: /etc/munge/ /var/log/munge/
chmod 0700 /etc/munge/ /var/log/munge/
systemctl enable munge
systemctl start munge
ทดสอบ Munge ว่าติดต่อไปยังเครื่องอื่นได้หรือไม่ โดยเข้าจาก Headnode
munge -n
munge -n | munge
munge -n | ssh 10.98.6.52 unmunge
remunge