centos下安装munge

时间:2024-10-06 07:25:23

centos下安装munge

控制节点node16
计算节点node16,node18


删除安装失败的munge

yum remove munge munge-libs munge devel -y
userdel -r munge
userdel: user munge is currently used by process 23785
kill 23785
userdel -r munge
  • 1
  • 2
  • 3
  • 4
  • 5

新建用户

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 
  • 1
  • 2
  • 3
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
  • 1
  • 2
  • 3

安装munge

先装epel库:

yum install epel-release
  • 1

再开始安装munge:

yum install munge munge-libs munge-devel -y
  • 1

安装rng工具:

yum install rng-tools -y 
rngd -r /dev/urandom
  • 1
  • 2

在控制节点上新建秘钥并设置权限:

/usr/sbin/create-munge-key -r
  • 1
dd if=/dev/urandom bs=1 count=1024 > /etc/munge/ 
chown munge: /etc/munge/ 
chmod 400 /etc/munge/
  • 1
  • 2
  • 3

将生成的秘钥发送到计算节点:
(注意node18要在root用户下,并且node16和node18的/etc/hosts文件需要配置ip和snode对应)

scp /etc/munge/ root@snode18:/etc/munge
  • 1

到计算节点上改权限:

chown -R munge: /etc/munge/ /var/log/munge/ 
chmod 0700 /etc/munge/ /var/log/munge/
  • 1
  • 2
systemctl enable munge 
systemctl start munge
  • 1
  • 2

测试munge是否装好:

munge -n 
munge -n | unmunge 
munge -n | ssh 3.buhpc.com unmunge 
remunge
  • 1
  • 2
  • 3
  • 4