Keeping accounts consistent across clusters using LDAP and YAMLhttps://www.linuxprobe.com/chapter-23.htmlhttps://github.com/eftales/ldap-videoTutorialhttps://blog.51cto.com/u_13994871/3788958
Slurm及OpenLDAP部署https://www.cnblogs.com/LiuChang-blog/p/12315166.htmlhttps://www.cnblogs.com/liwanliangblog/p/9991499.html#4.%E7%94%9F%E6%88%90LDIF%E6%A0%BC%E5%BC%8F%E6%96%87%E4%BB%B6
https://printing.its.uiowa.edu:9192/content/help/common/topics/sys-user-group-sync-ldap.html
https://blog.51cto.com/skypegnu1/1939552
https://devopstack.cn/linux/394.html#154_219216812364
https://blog.csdn.net/weixin_42728895/article/details/114540168
NFS实现LDAP用户/home配置有NIS或LDAP等用户信息服务同步admin节点用户信息(管理节点建立slurm用户后,各节点执行 id slurm 可确认其slurm用户是否存在)
由于集群中存在多个计算节点,那么提交作业时,所有的计算节点都必须存在此用户账户,并且UID需保持一致。因此在创建用户时需指定用户的UID,并且把用户信息同步到所有的计算节点。此处推荐有条件的用户采用ldap作为用户认证管理工具,适合集群上的用户认证机制,此次由于集群较小,没有使用ldap。
UIDNOW=1300 useradd test -p test -d /public/home/$1 -u ${UIDNOW} -s /bin/bash scp /etc/passwd /etc/shadow /etc/group cn02:/etc/ scp /etc/passwd /etc/shadow /etc/group cn03:/etc/ scp /etc/passwd /etc/shadow /etc/group cn04:/etc/ scp /etc/passwd /etc/shadow /etc/group cn05:/etc/
Slurm需要有一个用户用于进行通信、认证等操作,这里用户名为slurm(也可为其它名字):
useradd slurm pdsh -w node[1-10],login id slurm
其它节点配置有NIS或LDAP等用户信息管理系统,自动从管理节点获取slurm用户信息(无需再单独生成slurm用户),执行以下命令确认是否存在(如未存在,请检查相关服务):
docker run --hostname master --name master -it -d ubuntu-custom:1.0 bash docker run --hostname node2 --name node2 -it -d ubuntu-custom:1.0 bash docker run --hostname phpldapadmin --name phpldapadmin -it -d -p 80:80 ubuntu-custom:1.0 bash master 172.17.0.2 node1 172.17.0.3 apt install ldap-auth-config dpkg-reconfigure slapd dpkg-reconfigure ldap-auth-config getent passwd john cn=admin,dc=ldap,dc=com ldap://172.17.0.2/
apt-get install libnss-ldap ldap-utils apt-get install libnss-ldap ldap-utils libpam-ldap nslcd apt-get install libnss-ldap ldap-utils libpam-ldap nslcd sudo-ldap
getent passwd
LDAP NSS
apt-get install ldap-utils libnss-ldap
vim /etc/nsswitch.conf 修改为: passwd: files systemd ldap group: files systemd ldap shadow: files ldap gshadow: files hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis
ldapsearch -x -H ldaps://localhost -W -D cn=admin,dc=ldap,dc=com ldapsearch -H ldapi:// -Y EXTERNAL -b "cn=config" -LLL -Q -s base ldapmodify -Y EXTERNAL -H ldapi:/// -f certs.ldif