LiCO 7.0.0安装指南(适用于EL7.9)

第 1 章 概述


典型的集群部署

本指南基于包含管理节点、登录节点和计算节点的典型集群部署进行介绍。

下表对集群中的元素进行了说明。 表1. 典型集群中的元素说明

元素 描述
管理 节点 HPC/AI 集群的核心,承载集群管理、监控、调度、策略管理以及用户与帐户管理等主要功能。
计算节点 完成计算任务。
登录节点 将集群连接到外部网络或集群。用户必须使用登录节点登录并上传应用程序数据、开发编译器以及提交调度的任务。
文件服务 文件服务提供共享存储功能。它通过高速网络连接到集群节点。文件服务设置不在本指南的讨论范围内。我们使用简单的NFS 设置。
节点BMC接口 用于访问节点BMC 系统。
节点eth接口 用于管理集群中的节点。还可以用于传输计算数据。
高速网路接口 可选。用于支持文件服务。还可以用于传输计算数据。

注:LiCO 也支持仅包含管理节点和计算节点的集群部署。在这种情况下,所有安装在登录节点上的LiCO 模块都需要安装在管理节点上。


第2 章 部署集群环境

如果集群环境已存在,请跳过本章。
安装操作系统
安装正式版centos7.9。您可以选择最小安装。配置内存并重新启动操作系统:
echo '* soft memlock unlimited' >> /etc/security/limits.conf
echo '* hard memlock unlimited' >> /etc/security/limits.conf
reboot

在集群中的其他节点上部署操作系统

配置环境变量

步骤1. 登录到管理节点。
步骤2. 编辑/root/lico_env.local 并更新该文件中列出的环境变量:
# Management node hostname
sms_name="head"
# IP address of management node in the cluster intranet
sms_ip="192.168.0.2"
# Network interface card MAC address corresponding to the management node IP
sms_mac='b8:59:9f:2b:a2:e2'
# Management node BMC address.
sms_bmc='192.168.1.2'
# set the dns server
dns_server="192.168.10.10"
# set the ipv4 gateway
ipv4_gateway="192.168.0.1"
# Set the domain name
domain_name="hpc.com"
# Set OpenLDAP domain name
lico_ldap_domain_name="dc=hpc,dc=com"
# set OpenLDAP domain component
lico_ldap_domain_component="hpc"
# original OS repository directory
repo_backup_dir="/install/custom/backup"
# OS image pathway
iso_path="/isos"
# Local repository directory for OS
os_repo_dir="/install/custom/server"
sdk_repo_dir="/install/custom/sdk"
# Local repository directory for confluent
confluent_repo_dir="/install/custom/confluent"
# link name of repository directory for Lenovo OpenHPC
link_ohpc_repo_dir="/install/custom/ohpc"
# link name of repository directory for LiCO
link_lico_repo_dir="/install/custom/lico"
# link name of repository directory for LiCO-dep
link_lico_dep_repo_dir="/install/custom/lico-dep"
# Local repository directory for Lenovo OpenHPC, please change it
# according to this version.
ohpc_repo_dir="/install/custom/ohpc-1.3.9"
# LiCO repository directory for LiCO, please change it according to this version.
lico_repo_dir="/install/custom/lico-7.0.0"
# LiCO repository directory for LiCO-dep, please change it according to this version.
lico_dep_repo_dir="/install/custom/lico-dep-7.0.0"
# icinga api listener port
icinga_api_port=5665
# If the confluence automatic discovery mode is enabled, skip the following configurations.
# Total compute nodes
num_computes="2"
# Prefix of compute node hostname.
# Change the configuration according to actual conditions.
compute_prefix="c"
# Compute node hostname list.
# Change the configuration according to actual conditions.
c_name[0]=c1
c_name[1]=c2
# Compute node IP list.
# Change the configuration according to actual conditions.
c_ip[0]=192.168.0.6
c_ip[1]=192.168.0.16
# Network interface card MAC address corresponding to the compute node IP.
# Change the configuration according to actual conditions.
c_mac[0]=fa:16:3e:73:ec:50
c_mac[1]=fa:16:3e:27:32:c6
# Compute node BMC address list.
c_bmc[0]=192.168.1.6
c_bmc[1]=192.168.1.16
# Total login nodes. If there is no login node in the cluster, or the management node
# and the login node is the same node, the number of logins must be "0".
# And the 'l_name', 'l_ip', 'l_mac', and 'l_bmc' lines need to be removed.
num_logins="1"
# Login node hostname list.
# Change the configuration according to actual conditions.
l_name[0]=l1
# Login node IP list.
# Change the configuration according to actual conditions.
l_ip[0]=192.168.0.15
# Network interface card MAC address corresponding to the login node IP.
# Change the configuration according to actual conditions.
l_mac[0]=fa:16:3e:2c:7a:47
# Login node BMC address list.
l_bmc[0]=192.168.1.15
步骤3. 将更改保存到lico_env.local,并重新加载环境变量:
chmod 600 lico_env.local
source lico_env.local

设置好集群环境后,在登录或管理节点上配置公共网络的IP 地址。这样即可从外部网络登录到LiCO Web 门户。

创建本地存储库

创建本地存储库以安装操作系统。

对于CentOS

步骤1. 运行以下命令以创建ISO 存储的目录:
mkdir -p ${iso_path}
步骤2. 从http://isoredirect.centos.org/centos/7/isos/x86_64/下载CentOS-7-x86_64-Everything-2009.iso 和sha256sum.txt 文件。
步骤3. 将文件拷贝到${iso_path}。
步骤4. 运行以下命令以获取该iso 文件的验证码,并确保此验证码与sha256sum.txt 中的验证
码相同。
cd ${iso_path}
sha256sum CentOS-7-x86_64-Everything-2009.iso
cd ~
步骤5. 运行以下命令以装载镜像:
mkdir -p ${os_repo_dir}
mount -o loop ${iso_path}/CentOS-7-x86_64-Everything-2009.iso ${os_repo_dir}
步骤6. 运行以下命令以配置本地存储库:
cat << eof > ${iso_path}/EL7-OS.repo
[EL7-OS]
name=el7-centos
enabled=1
gpgcheck=0
type=rpm-md
baseurl=file://${os_repo_dir}
eof
cp -a ${iso_path}/EL7-OS.repo /etc/yum.repos.d/
步骤7. 运行以下命令以关闭该存储库:
yum install --disablerepo=CentOS* -y yum-utils
yum-config-manager --disable CentOS\*

对于RHEL

步骤1. 运行以下命令以创建ISO 存储的目录:
mkdir -p ${iso_path}
步骤2. 将RHEL-7.9-20200917.0-Server-x86_64-dvd1.iso和RHEL-7.9-20200917.0-Server-x86_64-dvd1.iso.MD5SUM 文件拷贝到${iso_path} 目录。
步骤3. 运行以下命令以检查iso 文件的有效性:
cd ${iso_path}
md5sum -c RHEL-7.9-20200917.0-Server-x86_64-dvd1.iso.MD5SUM
cd ~
步骤4. 运行以下命令以装载镜像:
mkdir -p ${os_repo_dir}
mount -o loop ${iso_path}/RHEL-7.9-20200917.0-Server-x86_64-dvd1.iso ${os_repo_dir}
步骤5. 运行以下命令以配置本地存储库:
cat << eof > ${iso_path}/RHELS7-OS.repo
[RHELS7-OS]
name=RHELS7-OS
enabled=1
gpgcheck=0
type=rpm-md
baseurl=file://${os_repo_dir}
eof
cp -a ${iso_path}/RHELS7-OS.repo /etc/yum.repos.d/

安装Lenovo Confluent

步骤1. 下载以下软件包:
https://hpc.lenovo.com/downloads/22a/confluent-3.4.0-2-el7.tar.xz                              
步骤2. 将该软件包上传到/root 目录。
步骤3. 创建Confluent 本地存储库:
yum install -y bzip2 tar
mkdir -p $confluent_repo_dir
cd /root
tar -xvf confluent-3.4.0-2-el7.tar.xz -C $confluent_repo_dir
cd $confluent_repo_dir/lenovo-hpc-el7
./mklocalrepo.sh
cd ~
步骤4. 安装Lenovo Confluent:
yum install -y lenovo-confluent tftp-server
systemctl enable confluent --now
systemctl enable tftp.socket --now
systemctl disable firewalld --now
systemctl enable httpd --now
步骤5. 创建Confluent 帐户:
source /etc/profile.d/confluent_env.sh
confetty create /users/<CONFLUENT_USERNAME> password=<CONFLUENT_PASSWORD> role=admin
步骤6. 关闭SELinux:
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0

通过Confluent 部署操作系统

注意:在Confluent 自动发现模式下部署集群时,请按照以下网站上的指导进行操作: • https://hpc.lenovo.com/users/documentation/confluentdisco.htmlhttps://hpc.lenovo.com/users/documentation/confluentquickstart_el8.html 建议在Confluent 中创建名为“all”、“login”、“compute”等的组,并将节点与特定组绑定;否则,本指南其余章节中提到的命令可能会无法使用。 指定全局行为 注:在指定全局行为之前,请确保节点中的BMC 用户名和密码一致;如果不一致,则应进行修改。 在Confluent 中,大多数配置都是面向节点的,可从一个组派生出来。默认组“everything”会自动添加到每个节点中,该组可用于指示全局设置。

nodegroupattrib everything deployment.useinsecureprotocols=firmware \
console.method=ipmi dns.servers=$dns_server dns.domain=$domain_name \
net.ipv4_gateway=$ipv4_gateway net.ipv4_method="static"

deployment.useinsecureprotocols=firmware 会启用PXE 支持(“仅限HTTPS”的模式默认是唯一允许的模式),console.method=ipmi 可以被跳过,但如果指定它,则会指示Confluent 使用IPMI访问文本控制台以启用nodeconsole 命令。可以采用相同的方式指定密码和类似内容,并建议使用-p 参数来提示输入值,以避免它们出现在命令历史记录中。请注意,如果未指定,则默认的根用户密码行为是禁用基于密码的登录:

nodegroupattrib everything -p bmcuser bmcpass crypted.rootpassword

在Confluent 中定义节点

步骤1. 在lico_env.local 文件中定义要用于Confluent 的管理节点:
nodegroupdefine all
nodegroupdefine login
nodegroupdefine compute
nodedefine $sms_name
nodeattrib $sms_name net.hwaddr=$sms_mac
nodeattrib $sms_name net.ipv4_address=$sms_ip
nodeattrib $sms_name hardwaremanagement.manager=$sms_bmc
步骤2. 定义要用于Confluent 的计算节点配置:
for ((i=0; i<$num_computes; i++)); do
nodedefine ${c_name[$i]};
nodeattrib ${c_name[$i]} net.hwaddr=${c_mac[$i]};
nodeattrib ${c_name[$i]} net.ipv4_address=${c_ip[$i]};
nodeattrib ${c_name[$i]} hardwaremanagement.manager=${c_bmc[$i]};
nodedefine ${c_name[$i]} groups=all,compute;
done
步骤3. 定义要用于Confluent 的登录节点配置:
for ((i=0; i<$num_logins; i++)); do
nodedefine ${l_name[$i]};
nodeattrib ${l_name[$i]} net.hwaddr=${l_mac[$i]};
nodeattrib ${l_name[$i]} net.ipv4_address=${l_ip[$i]};
nodeattrib ${l_name[$i]} hardwaremanagement.manager=${l_bmc[$i]};
nodedefine ${l_name[$i]} groups=all,login;
done
准备名称解析

注:不强制要求使用特定的名称解析解决方案,但如果没有相应的策略,可通过以下步骤设定一个基本策略。

步骤1. 将节点信息附加到/etc/hosts:
for node_name in $(nodelist); do
noderun -n $node_name echo {net.ipv4_address} {node} {node}.{dns.domain} >> /etc/hosts
done
步骤2. 安装并启动到dnsmasq,创建可通过dns 使用的/etc/hosts:
yum install -y dnsmasq
systemctl enable dnsmasq --now

初始化Confluent 操作系统部署 用户可以通过osdeploy 命令的已初始化的子命令来设置操作系统部署要求。-i 参数用于交互式地提示可用的选项:

ssh-keygen -t ed25519
chown confluent /var/lib/confluent
osdeploy initialize -i

执行操作系统部署 对于Centos

步骤1. 导入安装介质:
osdeploy import ${iso_path}/CentOS-7-x86_64-Everything-2009.iso
步骤2. 开始部署:
nodedeploy all -n centos-7.9-x86_64-default
步骤3. (可选)查看部署进度:
nodedeploy all

对于RHEL

步骤1. 导入安装介质:
osdeploy import ${iso_path}/RHEL-7.9-20200917.0-Server-x86_64-dvd1.iso     
步骤2. 开始部署:
nodedeploy all -n rhel-7.9-x86_64-default
步骤3. 检查部署过程:
nodedeploy all

为其他节点启用NGINX 注意:如果其他节点的操作系统是CentOS,请运行以下命令以关闭该存储库::

nodeshell all "yum install --disablerepo=CentOS* -y yum-utils"
nodeshell all "yum-config-manager --disable CentOS\*"

为其他节点禁用防火墙

nodeshell all "systemctl disable firewalld --now"
nodeshell all "sed -i 's/enforcing/disabled/' /etc/selinux/config"
nodeshell all "setenforce 0"

检查点A

检查并确保安装已完成:
nodeshell all uptime
注:输出应如下所示:
c1: 05:03am up 0:02, 0 users, load average: 0.20, 0.13, 0.05
c2: 05:03am up 0:02, 0 users, load average: 0.20, 0.14, 0.06
l1: 05:03am up 0:02, 0 users, load average: 0.17, 0.13, 0.05
……

为节点安装基础结构软件 注:在安装节点列中,M 代表“管理节点”,L 代表“登录节点”,C 代表“计算节点”。

软件名称 组件名称 版本 服务名称 安装节点 备注
nfs nfs-utils 1.3.0 nfs-server M /
chrony chrony 3.4 chronyd M、C、L /
slurm ohpc-slurm-server 1.3.8 mung、slurmctld M /
ohpc-slurm-client 1.3.8 mung、slurmd C、L /
icinga2 icinga2 2.13.5 icinga2 M、C、L /
singularity singularity-ohpc 3.7.1 / M
mpi openmpi3-gnu8-ohpc 3.1.4 / M 至少需要安装一种类型的MPI
mpich-gnu8-ohpc 3.3.1 / M
mvapich2-gnu8-ohpc 2.3 / M

为安装程序定义共享目录 以下步骤以/install/installer 为例,说明了如何为安装程序定义共享目录:

步骤1. 管理节点共享/install/installer:
yum install -y nfs-utils
systemctl enable nfs-server --now
share_installer_dir="/install/installer"
mkdir -p $share_installer_dir
echo "/install/installer *(rw,async,no_subtree_check,no_root_squash)" >> /etc/exports
exportfs -a
步骤2. 分发/etc/hosts:
cp /etc/hosts $share_installer_dir
scp $share_installer_dir/hosts c1:/etc/  (注:c1为计算节点的hostname,如果存在多台计算节点,请将此文件拷贝到其它所有计算节点)
步骤3. 启用httpd 服务:
cat << eof > /etc/httpd/conf.d/installer.conf
Alias /install /install
<Directory /install>
AllowOverride None
Require all granted
Options +Indexes +FollowSymLinks
</Directory>
eof
systemctl restart httpd
注:/install is the basic directory for repository which configured in the lico_env.local
file.
步骤4.对于CentOS,运行以下命令:
cp /etc/yum.repos.d/EL7-OS.repo $share_installer_dir
sed -i '/^baseurl=/d' $share_installer_dir/EL7-OS.repo
echo "baseurl=http://${sms_name}${os_repo_dir}" >>$share_installer_dir/EL7-OS.repo
scp $share_installer_dir/EL7-OS.repo c1:/etc/yum.repos.d/  (注:c1为计算节点的hostname,如果存在多台计算节点,请将此文件拷贝到其它所有计算节点)
对于RHEL,运行以下命令:
cp /etc/yum.repos.d/RHELS7-OS.repo $share_installer_dir
sed -i '/^baseurl=/d' $share_installer_dir/RHELS7-OS.repo
echo "baseurl=http://${sms_name}${os_repo_dir}" >>$share_installer_dir/RHELS7-OS.repo
scp $share_installer_dir/RHELS7-OS.repo c1:/etc/yum.repos.d/  (注:c1为计算节点的hostname,如果存在多台计算节点,请将此文件拷贝到其它所有计算节点)
步骤5. 启用存储库:
nodeshell all yum clean all
nodeshell all yum makecache
步骤6. 为集群节点安装NFS:
nodeshell all yum install -y nfs-utils
步骤7. 为集群节点配置该共享目录:
nodeshell all mkdir -p $share_installer_dir
nodeshell all "echo '${sms_ip}:/install/installer /install/installer \
nfs nfsvers=4.0,nodev,nosuid,noatime 0 0' >> /etc/fstab"
步骤8. 装载共享目录:
nodeshell all mount /install/installer

为其他节点配置内存

步骤1. 运行以下命令:
cp /etc/security/limits.conf $share_installer_dir
nodeshell all cp $share_installer_dir/limits.conf /etc/security/limits.conf
nodeshell all reboot
步骤2. 检查并确保安装已完成:
nodeshell all uptime

为管理节点配置本地yum 存储库

步骤1. 从https://hpc.lenovo.com/lico/downloads/5.5/Lenovo-OpenHPC-1.3.9.CentOS_7.x86_64.tar 下载包。
步骤2. 将包上传到管理节点上的/root directory 目录。
步骤3. 运行以下命令以配置本地Lenovo OpenHPC 存储库:
mkdir -p $ohpc_repo_dir
cd /root
tar xvf Lenovo-OpenHPC-1.3.9.CentOS_7.x86_64.tar -C $ohpc_repo_dir
rm -rf $link_ohpc_repo_dir
ln -s $ohpc_repo_dir $link_ohpc_repo_dir
$link_ohpc_repo_dir/make_repo.sh

为登录和计算节点配置本地yum 存储库

步骤1. 运行以下命令以添加本地存储库:
cp /etc/yum.repos.d/Lenovo.OpenHPC.local.repo $share_installer_dir
sed -i '/^baseurl=/d' $share_installer_dir/Lenovo.OpenHPC.local.repo
sed -i '/^gpgkey=/d' $share_installer_dir/Lenovo.OpenHPC.local.repo
echo "baseurl=http://${sms_name}${link_ohpc_repo_dir}/CentOS_7" \
>> $share_installer_dir/Lenovo.OpenHPC.local.repo
echo "gpgkey=http://${sms_name}${link_ohpc_repo_dir}/CentOS_7\
/repodata/repomd.xml.key" >> $share_installer_dir/Lenovo.OpenHPC.local.repo
步骤2. 运行以下命令为其他节点分发文件:
nodeshell all cp $share_installer_dir/Lenovo.OpenHPC.local.repo \
/etc/yum.repos.d/
nodeshell all "echo -e %_excludedocs 1 >> ~/.rpmmacros"

配置LiCO 依赖项存储库

步骤1. 下载以下软件包:
https://hpc.lenovo.com/lico/downloads/7.0/lico-dep-7.0.0.el7.x86_64.tgz
步骤2. 将该软件包上传到/root 目录。
步骤3. 为管理节点配置存储库:
mkdir -p $lico_dep_repo_dir
cd /root
tar -xvf lico-dep-7.0.0.el7.x86_64.tgz -C $lico_dep_repo_dir
rm -rf $link_lico_dep_repo_dir
ln -s $lico_dep_repo_dir $link_lico_dep_repo_dir
$link_lico_dep_repo_dir/mklocalrepo.sh
注意:在运行这些命令之前,需确保已事先为上述操作和后续操作在管理节点中配置了本地操作系统存储库。
步骤4. (可选)如果集群已存在,请检查您的版本
步骤5. 为其他节点配置存储库:
cp /etc/yum.repos.d/lico-dep.repo $share_installer_dir
sed -i '/^baseurl=/d' $share_installer_dir/lico-dep.repo
sed -i '/^gpgkey=/d' $share_installer_dir/lico-dep.repo
sed -i "/name=lico-dep-local-library/a\baseurl=http://${sms_name}\
${link_lico_dep_repo_dir}/library/" $share_installer_dir/lico-dep.repo
sed -i "/name=lico-dep-local-library/a\gpgkey=http://${sms_name}\
${link_lico_dep_repo_dir}/RPM-GPG-KEY-LICO-DEP-EL7" $share_installer_dir/lico-dep.repo
sed -i "/name=lico-dep-local-standalone/a\baseurl=http://${sms_name}\
${link_lico_dep_repo_dir}/standalone/" $share_installer_dir/lico-dep.repo
sed -i "/name=lico-dep-local-standalone/a\gpgkey=http://${sms_name}\
${link_lico_dep_repo_dir}/RPM-GPG-KEY-LICO-DEP-EL7" $share_installer_dir/lico-dep.repo
nodeshell all cp $share_installer_dir/lico-dep.repo /etc/yum.repos.d

获取LiCO 安装包 步骤1. 请与联想销售或支持人员联系获取EL7 的LiCO 7.0.0 发布包lico-release-7.0.0.el7.x86_64.tar.gz 和LiCO许可证文件。 步骤2. 将该发布包上传到管理节点。 为LiCO 配置本地存储库

步骤1. 为管理节点配置本地存储库:
mkdir -p $lico_repo_dir
tar zxvf lico-release-7.0.0.el7.x86_64.tar.gz -C $lico_repo_dir --strip-components 1
rm -rf $link_lico_repo_dir
ln -s $lico_repo_dir $link_lico_repo_dir
$link_lico_repo_dir/mklocalrepo.sh
步骤2. 为其他节点配置本地yum 存储库:
cp /etc/yum.repos.d/lico-release.repo $share_installer_dir
sed -i '/baseurl=/d' $share_installer_dir/lico-release.repo
sed -i "/name=lico-release-host/a\baseurl=http://${sms_name}\
${link_lico_repo_dir}/host/" $share_installer_dir/lico-release.repo
sed -i "/name=lico-release-public/a\baseurl=http://${sms_name}\
${link_lico_repo_dir}/public/" $share_installer_dir/lico-release.repo
步骤3. 分发存储库文件:
nodeshell all cp $share_installer_dir/lico-release.repo /etc/yum.repos.d/

配置Confluent 本地存储库

步骤1. 为其他节点配置本地存储库:
cp /etc/yum.repos.d/lenovo-hpc.repo $share_installer_dir
sed -i '/^baseurl=/d' $share_installer_dir/lenovo-hpc.repo
sed -i '/^gpgkey=/d' $share_installer_dir/lenovo-hpc.repo
echo "baseurl=http://${sms_name}${confluent_repo_dir}/lenovo-hpc-el7" \
>> $share_installer_dir/lenovo-hpc.repo
echo "gpgkey=http://${sms_name}${confluent_repo_dir}/lenovo-hpc-el7\
/lenovohpckey.pub" >> $share_installer_dir/lenovo-hpc.repo
步骤2. 分发存储库文件:
nodeshell all cp $share_installer_dir/lenovo-hpc.repo /etc/yum.repos.d/

安装Slurm

步骤1. 安装基础包:
yum install -y lenovo-ohpc-base
步骤2. 安装Slurm:
yum install -y ohpc-slurm-server 
步骤3. 安装Slurm 客户端:
nodeshell all yum install -y ohpc-base-compute ohpc-slurm-client lmod-ohpc 
步骤4. (可选)防止以非根用户身份登录到计算节点:
nodeshell compute "echo 'account required pam_slurm.so' >> /etc/pam.d/sshd"
注:To allow non-root logins to the compute nodes regardless of whether a Slurm
job is running on these nodes, skip this step. If this step is performed, the non-root
logins to the compute nodes will only be allowed when a Slurm job is running on
these nodes under a particular username. In this case, non-root ssh logins will work
for that particular username in this process.
步骤5. (可选)要保存以前的作业信息并使用内存计费功能,请参考以下信息来安装和配置slurm计费功能:
https://slurm.schedmd.com/accounting.html

配置NFS 配置用户共享目录 以下步骤以/home 为例说明了如何创建用户共享目录。

步骤1. 管理节点共享/home:
echo "/home *(rw,async,no_subtree_check,no_root_squash)" >> /etc/exports
exportfs -a
步骤2. 卸载已装载的/home:
nodeshell all "sed -i '/ \/home /d' /etc/fstab"
nodeshell all umount /home
步骤3. 为集群节点配置该共享目录:
nodeshell all "echo '${sms_ip}:/home /home nfs nfsvers=4.0,nodev,nosuid,noatime \
0 0' >> /etc/fstab"
步骤4. 装载共享目录:
nodeshell all mount /home

为OpenHPC 配置共享目录

步骤1. 管理用于OpenHPC 的节点共享/opt/ohpc/pub:
echo "/opt/ohpc/pub *(ro,no_subtree_check,fsid=11)" >> /etc/exports
exportfs -a
步骤2. 为集群节点配置共享目录:
nodeshell all mkdir -p /opt/ohpc/pub
nodeshell all "echo '${sms_ip}:/opt/ohpc/pub /opt/ohpc/pub nfs \
nfsvers=4.0,nodev,noatime 0 0' >> /etc/fstab"
步骤3. 装载共享目录:
nodeshell all mount /opt/ohpc/pub
注意:This directory is mandatory. If you have shared this directory from the
management node and mounted it on all other nodes, skip this step.

为监控配置监控目录

Step 1. 管理节点共享 /opt/lico/pub:
mkdir -p /opt/lico/pub
echo "/opt/lico/pub *(ro,sync,no_subtree_check,no_root_squash)" >> /etc/exports
exportfs -a
Step 2. 为集群节点配置共享目录:
nodeshell all mkdir -p /opt/lico/pub
nodeshell all "echo '${sms_ip}:/opt/lico/pub /opt/lico/pub nfs nfsvers=4.0,nodev,noatime \
0 0' >> /etc/fstab"
Step 3. 挂载共享目录:
nodeshell all mount /opt/lico/pub

配置Chrony 注:如果已为集群中的节点配置Chrony 服务,请跳过本节。

步骤1. 安装Chrony:
yum install -y chrony
步骤2. 集群时间不同步可能会导致意外问题。请参考以下信息来配置chronyd 服务:
https://chrony.tuxfamily.org/documentation.html

安装GPU 驱动程序

应在每个GPU 计算节点上安装GPU 驱动程序。如果只有部分节点安装了GPU,请将nodeshell
命令中的compute 参数替换为GPU 节点对应的节点范围。
禁用Nouveau 驱动程序
要安装显示驱动程序,请先禁用Nouveau 驱动程序。
步骤1. 将操作系统配置为在文本控制台上启动,然后重新启动系统:
注:仅当操作系统配置为在图形桌面上启动时才需要执行此步骤。
nodeshell compute systemctl set-default multi-user.target
步骤2. 添加配置文件:
cat << eof > $share_installer_dir/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
eof
步骤3. 分发配置文件:
nodeshell compute cp $share_installer_dir/blacklist-nouveau.conf \
/usr/lib/modprobe.d/blacklist-nouveau.conf
步骤4. 重新生成内核initramfs:
nodeshell compute dracut --force
步骤5. 使配置生效:
nodeshell compute reboot

安装GPU 驱动程序

步骤1. 从https://us.download.nvidia.com/tesla/520.61.07/NVIDIA-Linux-x86_64-520.61.07.run,下载NVIDIA 驱动程序,并将其复制到共享目录$share_installer_dir。
步骤2. 运行以下命令:
yum install -y tar bzip2 make automake gcc gcc-c++ pciutils \
elfutils-libelf-devel libglvnd-devel
yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)
chmod +x $share_installer_dir/NVIDIA-Linux-x86_64-520.61.07.run
$share_installer_dir/NVIDIA-Linux-x86_64-520.61.07.run --add-this-kernel -s
nodeshell compute $share_installer_dir/NVIDIA-Linux-x86_64-520.61.07-custom.run -s
步骤3. 在GPU 节点上运行以下命令来确定是否可以识别到GPU:
nodeshell compute nvidia-smi
注:如果运行该命令无法识别GPU 信息,请重启所有GPU 节点。然后重新运行该命令。
nodeshell compute reboot

为GPU 驱动程序配置自动启动

步骤1. 添加配置文件:
cat << eof > $share_installer_dir/nvidia-persistenced.service
[Unit]
Description=NVIDIA Persistence Daemon
After=syslog.target
[Service]
Type=forking
PIDFile=/var/run/nvidia-persistenced/nvidia-persistenced.pid
Restart=always
ExecStart=/usr/bin/nvidia-persistenced --verbose
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced/*
TimeoutSec=300
[Install]
WantedBy=multi-user.target
eof
cat << eof > $share_installer_dir/nvidia-modprobe-loader.service
[Unit]
Description=NVIDIA ModProbe Service
After=syslog.target
Before=slurmd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/nvidia-modprobe -u -c=0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
eof
步骤2. 分发配置文件:
nodeshell compute cp $share_installer_dir/nvidia-persistenced.service \
/usr/lib/systemd/system/nvidia-persistenced.service
nodeshell compute cp $share_installer_dir/nvidia-modprobe-loader.service \
/usr/lib/systemd/system/nvidia-modprobe-loader.service
nodeshell compute mkdir -p /var/run/nvidia-persistenced
步骤3. 重新启动服务:
nodeshell compute systemctl daemon-reload
nodeshell compute systemctl enable nvidia-persistenced --now
nodeshell compute systemctl enable nvidia-modprobe-loader.service --now

配置Slurm

步骤1. 从以下网站下载slurm.conf:
https://hpc.lenovo.com/lico/downloads/7.0/examples/conf/
步骤2. 将slurm.conf 上传到$share_installer_dir,并根据配置“slurm.conf”中的说明修改此文件。
步骤3. 从以下网站下载cgroup.conf:
https://hpc.lenovo.com/lico/downloads/7.0/examples/conf/
步骤4. 将cgroup.conf 上传到$share_installer_dir。
步骤5. 分发配置:
cp $share_installer_dir/slurm.conf /etc/slurm/slurm.conf
nodeshell all cp $share_installer_dir/slurm.conf /etc/slurm/slurm.conf
cp $share_installer_dir/cgroup.conf /etc/slurm/cgroup.conf
nodeshell all cp $share_installer_dir/cgroup.conf /etc/slurm/cgroup.conf
cp /etc/munge/munge.key $share_installer_dir
nodeshell all cp $share_installer_dir/munge.key /etc/munge/munge.key
步骤6. (可选)仅适用于GPU 节点:
• 如果在GPU 节点中启用了Nvidia MIG,请配置GPU 节点。有关更多信息,请参阅:https://gitlab.com/nvidia/hpc/slurm-mig-discovery
• 如果在GPU 节点中禁用或不支持Nvidia MIG,请从https://hpc.lenovo.com/lico/downloads/7.0/examples/conf/ 下载示例文件gres.conf,根据您的需要编辑该示例文件,然后将其上传到GPU 节点上的/etc/slurm 中。
步骤7. 启动服务:
systemctl enable munge
systemctl enable slurmctld
systemctl restart munge
systemctl restart slurmctld
步骤8. 启动其他节点服务:
nodeshell all systemctl enable munge
nodeshell all systemctl restart munge
nodeshell all systemctl enable slurmd
nodeshell all systemctl restart slurmd

配置slurm.conf

需要配置的典型字段如下:
• 集群名称:
ClusterName=mycluster
• 管理节点名称:
SlurmctldHost=c031
• GPU 调度:
GresTypes=gpu
注:在集群中,仅当包含GPU 节点时才需要使用此条目。如果集群不包含GPU 节点,请删除此条目。
• 集群节点定义:
NodeName=c031 Gres=gpu:4 CPUs=28 RealMemory=200000 State=UNKNOWN
NodeName=c032 Gres=gpu:4 CPUs=28 RealMemory=200000 State=UNKNOWN
– Gres:GPU 数量
– CPUs:节点上的CPU 数量。
– RealMemory:节点的内存大小(单位:M)。
• 分区定义:
PartitionName=compute Nodes=c0[31-32] Default=YES MaxTime=INFINITE State=UP
PartitionName=compute1 Nodes=c0[31-32] Default=NO MaxTime=INFINITE State=UP
注:
– Default:标识此分区是否为默认分区。提交作业时,可以选择一个分区。如果不选择分区,则会使用默认分区。
– Nodes : NodeName 列表。如果NodeName 无规律, 允许Nodes=[nodename1,nodename2,...]
。
• 强制实施分区限制定义:
EnforcePartLimits=ALL
注意:如果要在作业请求的资源超过集群资源量时提交直接错误响应,请使用此配置。否则,作业将保留在队列中。有关如何配置slurm.conf 的更多详细信息,请参阅Slurm 官方网站:
https://slurm.schedmd.com/slurm.conf.html

gres.conf

该配置文件描述了安装在GPU 节点上的GPU 和GPU 内存。此文件的内容可能因GPU 节点而异。
请修改以下内容:
Name=gpu File=/dev/nvidia[0-3]
注:应该将/dev/nvidia[0-3] 中的[0–3] 更改为您的实际GPU 配置。例如,/dev/nvidia0 表示一张GPU 卡,而/dev/nvidia[0-1] 则表示两张GPU 卡。

(可选)安装Icinga2 注:如果没有使用LiCO 来监控集群,请跳过本节。 如果已准备好IB 设备,并且需要安装IB 驱动程序,请在安装Icinga2 之前参考LeSI 22A_SI 最佳配置在操作系统中安装IB 驱动程序。USB 网卡会影响MPI 调用的IB 网卡。因此,建议在开机过程中添加“rmmod cdc_ether”,以删除USB 网卡。

步骤1. 安装icinga2:
yum install -y icinga2
nodeshell all yum install -y icinga2
步骤2. 安装LiCO icinga2 插件:
yum install -y nagios-plugins-ping lico-icinga-plugin-slurm
步骤3. 打开API 功能:
icinga2 api setup
步骤4. 配置icinga2:
icinga2 node setup --master --disable-confd
echo -e "LANG=en_US.UTF-8" >> /etc/sysconfig/icinga2
systemctl restart icinga2
步骤5. 为其他节点配置icinga2 代理:
nodeshell all icinga2 pki save-cert --trustedcert \
/var/lib/icinga2/certs/trusted-parent.crt --host ${sms_name}

for ((i=0;i<$num_computes;i++));do
ticket=`icinga2 pki ticket --cn ${c_name[${i}]}`
nodeshell ${c_name[${i}]} icinga2 node setup --ticket ${ticket} --cn ${c_name[${i}]} \
--endpoint ${sms_name} --zone ${c_name[${i}]} --parent_zone master --parent_host \
${sms_name} --trustedcert /var/lib/icinga2/certs/trusted-parent.crt \
--accept-commands --accept-config --disable-confd
done

for ((i=0;i<$num_logins;i++));do
ticket=`icinga2 pki ticket --cn ${l_name[${i}]}`
nodeshell ${l_name[${i}]} icinga2 node setup --ticket ${ticket} --cn ${l_name[${i}]} \
--endpoint ${sms_name} --zone ${l_name[${i}]} --parent_zone master --parent_host \
${sms_name} --trustedcert /var/lib/icinga2/certs/trusted-parent.crt \
--accept-commands --accept-config --disable-confd
done

nodeshell all "echo -e 'LANG=en_US.UTF-8' >> /etc/sysconfig/icinga2"
nodeshell all systemctl restart icinga2
步骤6. 在管理节点上配置全局模板文件:
mkdir -p /etc/icinga2/zones.d/global-templates

echo -e "object CheckCommand \"lico_monitor\" {\n command = [ \"/opt/lico/pub/monitor/\
lico_icinga_plugin/lico-icinga-plugin\" ]\n}" > /etc/icinga2/zones.d/global-templates/commands.conf

echo -e "object CheckCommand \"lico_job_monitor\" {\n command = [\"/opt/lico/pub/monitor/\
lico_icinga_plugin/lico-job-icinga-plugin\" ]\n}" >> /etc/icinga2/zones.d/global-\
templates/commands.conf

echo -e "object CheckCommand \"lico_check_procs\" {\n command =[ \"/opt/lico/pub/monitor\
/lico_icinga_plugin/lico-process-icinga-plugin\" ]\n}" >>/etc/icinga2/zones.d/global-\
templates/commands.conf

echo -e "object CheckCommand \"lico_vnc_monitor\" {\n command =[ \"/opt/lico/pub/monitor/\
lico_icinga_plugin/lico-vnc-icinga-plugin\" ]\n}" >> /etc/icinga2/zones.d/global-\
templates/commands.conf

chown -R icinga:icinga /etc/icinga2/zones.d/global-templates
步骤7. 定义区域文件:
mkdir -p /etc/icinga2/zones.d/master

echo -e "object Host \"${sms_name}\" {\n check_command = \"hostalive\"\n \
address = \"${sms_ip}\"\n vars.agent_endpoint = name\n}\n" >> \
/etc/icinga2/zones.d/master/hosts.conf

for ((i=0;i<$num_computes;i++));do
echo -e "object Endpoint \"${c_name[${i}]}\" {\n host = \"${c_name[${i}]}\"\n \
port = \"${icinga_api_port}\"\n log_duration = 0\n}\nobject \
Zone \"${c_name[${i}]}\" {\n endpoints = [ \"${c_name[${i}]}\" ]\n \
parent = \"master\"\n}\n" >> /etc/icinga2/zones.d/master/agent.conf
echo -e "object Host \"${c_name[${i}]}\" {\n check_command = \"hostalive\"\n \
address = \"${c_ip[${i}]}\"\n vars.agent_endpoint = name\n}\n" >> \
/etc/icinga2/zones.d/master/hosts.conf
done

for ((i=0;i<$num_logins;i++));do
echo -e "object Endpoint \"${l_name[${i}]}\" {\n host = \"${l_name[${i}]}\"\n \
port = \"${icinga_api_port}\"\n log_duration = 0\n}\nobject \
Zone \"${l_name[${i}]}\" {\n endpoints = [ \"${l_name[${i}]}\" ]\n \
parent = \"master\"\n}\n" >> /etc/icinga2/zones.d/master/agent.conf
echo -e "object Host \"${l_name[${i}]}\" {\n check_command = \"hostalive\"\n \
address = \"${l_ip[${i}]}\"\n vars.agent_endpoint = name\n}\n" >> \
/etc/icinga2/zones.d/master/hosts.conf
done

echo -e "apply Service \"lico\" {\n check_command = \"lico_monitor\"\n \
max_check_attempts = 5\n check_interval = 1m\n retry_interval = 30s\n assign \
where host.name == \"${sms_name}\"\n assign where host.vars.agent_endpoint\n \
command_endpoint = host.vars.agent_endpoint\n}\n" > \
/etc/icinga2/zones.d/master/service.conf

echo -e "apply Service \"lico-procs-service\" {\n check_command = \"lico_\
check_procs\"\n enable_active_checks = false\n assign where \
host.name == \"${sms_name}\"\n assign where host.vars.agent_endpoint\n \
command_endpoint = host.vars.agent_endpoint\n}\n" >> \
/etc/icinga2/zones.d/master/service.conf

echo -e "apply Service \"lico-job-service\" {\n check_command = \"lico_job_monitor\"\n \
max_check_attempts = 5\n check_interval = 1m\n retry_interval = 30s\n assign \
where host.name == \"${sms_name}\"\n assign where host.vars.agent_endpoint\n \
command_endpoint = host.vars.agent_endpoint\n}\n" >> \
/etc/icinga2/zones.d/master/service.conf

echo -e "apply Service \"lico-vnc-service\" {\n check_command = \"lico_vnc_monitor\"\n \
max_check_attempts = 5\n check_interval = 15s\n retry_interval = 30s\n assign \
where host.name == \"${sms_name}\"\n assign where host.vars.agent_endpoint\n \
command_endpoint = host.vars.agent_endpoint\n}\n" >> \
/etc/icinga2/zones.d/master/service.conf

chown -R icinga:icinga /etc/icinga2/zones.d/master
chmod u+s /opt/lico/pub/monitor/lico_icinga_plugin/lico-vnc-icinga-plugin
systemctl restart icinga2
步骤8. 启用服务:
nodeshell all modprobe ipmi_devintf
nodeshell all systemctl enable icinga2

modprobe ipmi_devintf
systemctl enable icinga2
步骤9. (可选)检查配置:
icinga2 daemon -C

安装MPI

步骤1. 运行以下命令以将三个模块(OpenMPI、MPICH 和MVAPICH)安装到系统:
yum install -y openmpi3-gnu8-ohpc mpich-gnu8-ohpc mvapich2-gnu8-ohpc
步骤2. 设置默认模块。
运行以下命令以将OpenMPI 模块设置为默认模块:
yum install -y lmod-defaults-gnu8-openmpi3-ohpc
运行以下命令以将MPICH 模块设置为默认模块:
yum install -y lmod-defaults-gnu8-mpich-ohpc
运行以下命令以将MVAPICH 模块设置为默认模块:
yum install -y lmod-defaults-gnu8-mvapich2-ohpc
注:MVAPICH 要求Infiniband 或OPA 存在且工作正常。应安装以下包以支持Infiniband
或OPA:
yum list installed libibmad5 librdmacm1 rdma infinipath-psm dapl-devel \
dapl-utils libibverbs-utils

MPI 类型之间的依赖关系 安装MPI 时,请遵循以下依赖关系: • 要使用MVAPICH2(psm2),请安装mvapich2-psm2-gnu8-ohpc。 • 要使用OpenMPI(PMIx),请安装openmpi3-pmix-slurm-gnu8-ohpc。 • openmpi3-gnu8-ohpc 与openmpi3-pmix-slurm-gnu8-ohpc 不兼容。 • mvapich2-psm2-gnu8-ohpc 与mvapich2-gnu8-ohpc 不兼容。

安装Singularity Singularity 是一个面向HPC 的轻型容器框架。

步骤1. 运行以下命令安装Singularity:
yum install -y singularity-ohpc
步骤2. 通过将以下内容添加到module try-add 区块的末尾以编辑
/opt/ohpc/pub/modulefiles/ohpc:
module try-add singularity
步骤3. 在module del 区块中,添加以下内容作为第一行:
module del singularity
步骤4. 运行以下命令:
source /etc/profile.d/lmod.sh
如果默认模块随着lmod-defaults* 包的安装发生了更改,对/opt/ohpc/pub/modulefiles/ohpc
所做的更改可能会丢失。此情况下, 请再次修改/opt/ohpc/pub/modulefiles/ohpc , 或在
/etc/profile.d/lmod.sh 的末尾添加module try-add singularity。

检查点B

步骤1. 运行以下命令以测试Slurm 是否已正确安装:
sinfo
注:
• 输出应如下所示:
PARTITION AVAIL TIMELIMIT NODES STATE NODELIST
normal* up 1-00:00:00 2 idle c[1-2]
……
• 所有节点的状态应为idle;不接受idle*。
步骤2. 运行以下命令以添加test 帐户:
useradd test -m --uid 65530
nodeshell all useradd test -m --uid 65530
步骤3. 使用测试帐户和Slurm 分发的测试程序登录到计算节点:
su - test
mpicc -O3 /opt/ohpc/pub/examples/mpi/hello.c
srun -n 8 -N 1 -w <NODENAME> -p <PARTITIONNAME> --pty /bin/bash
prun ./a.out
注:输出应如下所示:
Master compute host = c1
Resource manager = slurm
Launch cmd = mpiexec.hydra -bootstrap slurm ./a.out
Hello, world (8 procs total)
--> Process # 0 of 8 is alive. -> c1
--> Process # 4 of 8 is alive. -> c2
--> Process # 1 of 8 is alive. -> c1
--> Process # 5 of 8 is alive. -> c2
--> Process # 2 of 8 is alive. -> c1
--> Process # 6 of 8 is alive. -> c2
--> Process # 3 of 8 is alive. -> c1
--> Process # 7 of 8 is alive. -> c2
步骤4. 结束测试:
exit
注:要离开“test”用户会话,请再次输入“exit”。
步骤5. 删除该test 用户:
nodeshell all userdel test
userdel test -r
命令执行完毕后,您将切换为管理节点的根用户。

第3 章安装LiCO 依赖项

集群检查 检查环境变量{lico_ldap_domain_name} 和${lico_repo_dir}

echo $sms_name;echo $lico_repo_dir;echo $lico_ldap_domain_name
注:
• 输出应如下所示:
head
/install/custom/lico-7.0.0
dc=hpc,dc=com
检查安装程序的共享目录
检查共享目录$share_installer_dir:
echo $share_installer_dir
注:
• 输出应如下所示:
/install/installer
检查LiCO 依赖项存储库:
yum repolist | grep lico-dep-local
注:
• 输出应如下所示:
lico-dep-local-library          lico-dep-local-library                       234
lico-dep-local-standalone       lico-dep-local-standalone                    108
检查LiCO 存储库:
yum repolist | grep lico-release
lico-release-host               lico-release-host                             82
lico-release-public             lico-release-public                           42
检查NFS
注:如果集群不使用NFS 作为分布式文件系统,请跳过本节。
检查NFS 服务:
systemctl status nfs-server | grep Active && exportfs -v | grep -E '/home|/opt/ohpc/pub'
注:
• 输出应如下所示:
Active: active (exited) since Sat 2019-10-12 16:04:21 CST; 2 days ago
/opt/ohpc/pub <world> (sync,wdelay,hide,no_subtree_check,sec=sys,ro,secure,root_squash,no_all_
squash)
/home <world>(async,wdelay,hide,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
请检查所有其他节点上的装载点:
nodeshell all "df | grep -E '/home | /opt/ohpc/pub'"
注:
• 输出应如下所示:
c1: 10.1.1.31:/home 485642240 111060992 374581248 23% /home
c1: 10.1.1.31:/opt/ohpc/pub 485642240 111060992 374581248 23% /opt/ohpc/pub
检查Slurm
检查slurmctld:
systemctl status slurmctld | grep Active
注:
• 输出应如下所示:
Active: active (running) since Tue 2018-07-24 19:02:49 CST; 1 months 20 days ago
检查计算节点上的slurmd:
nodeshell compute "systemctl status slurmd | grep Active"
注:
• 输出应如下所示:
c1: Active: active (running) since Tue 2018-07-24 19:02:49 CST; 1 months 20 days ago
c2: Active: active (running) since Sat 2018-07-21 17:16:59 CST; 1 months 23 days ago

检查MPI 和Singularity

module list
注:
• 输出应如下所示:
Currently Loaded Modules:
  1) prun/1.3   2) gnu8/8.3.0   3) openmpi3/3.1.4   4) singularity/3.7.1   5) ohpc

安装LiCO 依赖项

注:在安装节点列中,M 代表“管理节点”,L 代表“登录节点”,C 代表“计算节点”。

软件 组件 版本 服务 安装节点 备注
rabbitmq rabbitmq-server 3.9.10 rabbitmq-server M
mariadb mariadb-server 10.3.32 mariadb-server M
influxdb influxdb 1.8.10 influxdb M
confluent confluent 3.4.0 confluent M
libuser libuser 0.62 M
python3-libuser 0.62 M

安装RabbitMQ LiCO 使用RabbitMQ 作为消息代理。

步骤1. 安装RabbitMQ:
yum install -y rabbitmq-server
步骤2. 启动RabbitMQ 服务:
systemctl enable rabbitmq-server --now

安装MariaDB LiCO 使用MariaDB 作为数据存储的对象相关数据库。

步骤1. 安装MariaDB:
yum install -y mariadb-server mariadb-devel
步骤2. 启动MariaDB 服务:
systemctl enable mariadb --now
步骤3. 为LiCO 配置MariaDB:
注:安装lico-passwd-tool 时将使用此处的用户名和密码。因此,请在安装MariaDB 时
记录这些信息。
mysql
create database lico character set utf8 collate utf8_bin;
create user '<USERNAME>'@'%' identified by '<PASSWORD>';
grant ALL on lico.* to '<USERNAME>'@'%';
exit
步骤4. 配置MariaDB 限制:
sed -i "/\[mysqld\]/a\max-connections=1024" /etc/my.cnf.d/mariadb-server.cnf
mkdir /usr/lib/systemd/system/mariadb.service.d
cat << eof > /usr/lib/systemd/system/mariadb.service.d/limits.conf
[Service]
LimitNOFILE=10000
eof
systemctl daemon-reload
systemctl restart mariadb

安装InfluxDB LiCO 使用InfluxDB 作为执行存储监控的时间序列数据库。

步骤1. 安装InfluxDB:
yum install -y influxdb
systemctl enable influxdb --now
步骤2. 创建InfluxDB 用户:
• 进入InfluxDB shell:
influx
• 创建数据库:
create database lico
• 使用数据库:
use lico
• 创建管理员用户时,请确保使用字符串密码:
create user <INFLUX_USERNAME> with password '<INFLUX_PASSWORD>' with all privileges
• 退出InfluxDB shell:
exit
• 进行配置:
sed -i '/# auth-enabled = false/a\ auth-enabled = true' /etc/influxdb/config.toml
• 重新启动InfluxDB:
systemctl restart influxdb

配置用户认证 安装OpenLDAP 注:如果配置了OpenLDAP 或已在集群中使用其他认证服务,请跳过本节。OpenLDAP 是轻量级目录访问协议的开源版本。建议使用OpenLDAP 来管理用户。但是,LiCO也支持与Linux-PAM 兼容的其他认证服务。

步骤1. 安装OpenLDAP:
yum install -y slapd-ssl-config openldap-servers
步骤2. 修改配置文件:
sed -i "s/dc=hpc,dc=com/${lico_ldap_domain_name}/" /usr/share/openldap-servers/lico.ldif
sed -i "/dc:/s/hpc/${lico_ldap_domain_component}/" /usr/share/openldap-servers/lico.ldif
sed -i "s/dc=hpc,dc=com/${lico_ldap_domain_name}/" /etc/openldap/slapd.conf
slapadd -v -l /usr/share/openldap-servers/lico.ldif -f /etc/openldap/slapd.conf -b \
${lico_ldap_domain_name}
步骤3. 获取OpenLDAP 密钥:
slappasswd
步骤4. 编辑/etc/openldap/slapd.conf,将根用户密码设置为获得的密钥。
rootpw <ENCRYPT_LDAP_PASSWORD>
步骤5. 更改配置文件的所属用户:
chown -R ldap:ldap /var/lib/ldap
chown ldap:ldap /etc/openldap/slapd.conf
步骤6. 编辑/etc/sysconfig/slapd 配置,并确保和如下配置一致。
SLAPD_URLS="ldapi:/// ldap:/// ldaps:///"
SLAPD_OPTIONS="-f /etc/openldap/slapd.conf"
步骤7. 启动OpenLDAP 服务:
systemctl enable slapd --now
步骤8. 验证该服务是否已启动:
systemctl status slapd

安装libuser libuser 模块是OpenLDAP 的推荐工具包。该模块的安装是可选的。

步骤1. 安装libuser:
yum install -y libuser python3-libuser
步骤2. 从https://hpc.lenovo.com/lico/downloads/7.0/examples/conf/ 将libuser.conf 下载到管理节点上的/etc 中,然后按照文件中的说明修改此文件。

安装OpenLDAP-client

echo "TLS_REQCERT never" >> /etc/openldap/ldap.conf
cp /etc/openldap/ldap.conf $share_installer_dir
nodeshell all cp $share_installer_dir/ldap.conf /etc/openldap/ldap.conf

安装nss-pam-ldapd nss-pam-ldapd 是一个名称服务交换模块和可插拔认证模块。LiCO 使用此模块来认证用户。

步骤1. 运行以下命令以在管理节点上安装nss-pam-ldapd:
yum install -y nss-pam-ldapd authconfig
authconfig --useshadow --usemd5 --enablemkhomedir --disablecache \
--enablelocauthorize --disablesssd --disablesssdauth \
--enableforcelegacy --enableldap --enableldapauth --disableldaptls \
--ldapbasedn=${lico_ldap_domain_name} --ldapserver="ldap://${sms_name}" --updateall
echo "rootpwmoddn uid=admin,${lico_ldap_domain_name}" >> /etc/nslcd.conf
systemctl enable nslcd
systemctl start nslcd
步骤2. 运行以下命令以在其他节点上安装nss-pam-ldapd:
nodeshell all yum install -y nss-pam-ldapd authconfig
nodeshell all authconfig --useshadow --usemd5 --enablemkhomedir \
--disablecache --enablelocauthorize --disablesssd \
--disablesssdauth --enableforcelegacy --enableldap --enableldapauth \
--disableldaptls --ldapbasedn="${lico_ldap_domain_name}" \
--ldapserver="ldap://${sms_name}" --updateall
nodeshell all echo "\""rootpwmoddn uid=admin,${lico_ldap_domain_name}"\"" \>\> /etc/nslcd.conf
nodeshell all systemctl enable nslcd
nodeshell all systemctl start nslcd
注:默认情况下,xCAT 部署操作系统将禁用SElinux。因此,运行authconfig 命令将输出一条参考消息,如“getsebool: SELinux is disabled”。您可以忽略此消息,其并不影响功能。

第4 章 安装LiCO

安装LiCO Core

注:在安装节点列中,M 代表“管理节点”,L 代表“登录节点”,C 代表“计算节点”。

表7. 要安装的LiCO 组件列表

组件 软件 版本 服务 安装节点 备注
lico-core lico-core 7.0.0 lico M
lico-portal lico-portal 7.0.0 L
lico-core-extend lico-confluent-proxy 1.2.1 M
lico-vnc-proxy 1.3.0 lico-vnc-proxy M
lico-env lico-ai-scripts 1.3.0 M
lico monitor lico-icinga-mond 1.5.0 lico-icinga-mond M
lico-icinga-plugin-slurm 1.5.0 M
lico alarm notification lico-sms-agent 1.2.7 lico-sms-agent M 如果需要通过短信发送警报,则是必需的
lico-wechat-agent 1.2.7 lico-wechat-agent M 如果需要通过微信发送警报,则是必需的
lico-mail-agent 1.3.8 lico-mail-agent M 如果需要通过电子邮件发送警报,则是必需的
lico manager lico-file-manager 2.2.2 lico-file-manager M 基本组件
lico-task lico-async-task 1.1.2 lico-async-task、lico-async-task-proxy M、L
步骤1. 根据需要执行以下操作之一:
• 要使用LiCO 进行集群监控,请按以下方式安装LiCO 模块:
对于Centos,安装lico-async-task之前需要配置源:
cat << eof >>${iso_path}/EL7-OS.repo
[EL7-extras]
name=el7-extras
enabled=1
baseurl=http://mirror.centos.org/centos/7/extras/x86_64/
eof
cp -a ${iso_path}/EL7-OS.repo /etc/yum.repos.d/

(可选)对于REHL,安装lico-async-task之前需要配置源:
cat << eof >>${iso_path}/RHELS7-OS.repo
[EL7-extras]
name=el7-extras
enabled=1
baseurl=http://mirror.centos.org/centos/7/extras/x86_64/
eof
cp -a ${iso_path}/RHELS7-OS.repo /etc/yum.repos.d/

步骤2.开始安装lico组件
yum clean all
yum makecache
yum install -y python3-cffi
yum install -y lico-core lico-file-manager lico-confluent-proxy \
lico-vnc-proxy lico-icinga-mond lico-async-task lico-service-tool \
lico-ai-scripts
步骤3. (可选)提供电子邮件、短息和微信服务:
yum install -y lico-mail-agent
yum install -y lico-sms-agent
yum install -y lico-wechat-agent
步骤4. 重新启动服务:
systemctl restart confluent 

在登录节点上安装LiCO 模块:

nodeshell login yum install -y lico-workspace-skeleton lico-portal lico-service-tool

第5 章 配置LiCO

配置服务帐户
注:
• 本指南中配置了MariaDB、InfluxDB、Confluent 和LDAP 的用户名或密码。
• 从/etc/icinga2/conf.d/api-users.conf 文件中获取icinga2 的用户名和密码。
在管理节点上,使用工具lico-password-tool。
按照以下提示输入MariaDB、InfluxDB、Confluent、Icinga2 和LDAP 的用户名或密码:
lico-password-tool
为其他节点配置服务帐户:
nodeshell login mkdir -p /var/lib/lico/tool
cp /var/lib/lico/tool/.db $share_installer_dir
nodeshell login cp $share_installer_dir/.db /var/lib/lico/tool
配置集群节点
步骤1. 将集群信息导入系统:
cp /etc/lico/nodes.csv.example /etc/lico/nodes.csv
步骤2. 编辑集群信息文件:
vi /etc/lico/nodes.csv
注:建议您将此文件下载到本地计算机,并使用Excel 或其他表格编辑软件编辑该文件。之后,您可以将其上传到管理节点并覆盖原始文件。

机房信息 以下是机房信息表的示例。

表8. 机房信息表

room name location_description
Shanghai Solution Room Shanghai Zhangjiang

在name 和location_description 字段中输入一个信息条目。

逻辑组信息 管理人员可以使用逻辑组将集群中的节点划分为不同的组。逻辑组不会影响对计算机资源的使用或 权限配置。 以下是逻辑组信息表的示例。

表9. 逻辑组信息表

group name
login

您需要在name 字段中输入至少一个逻辑组名称。 机房行信息 机房行是指机房内的机架顺序。输入集群节点所在机架行的信息。 以下是机房行信息表的示例。 表10. 机房行信息表

row name index belonging_room
row1 1 Shanghai Solution Room

请在以下字段中输入至少一个行信息条目: • name:行名称(在同一个机房内必须是唯一的) • index:行顺序(必须是正整数,并且在同一个机房内必须是唯一的) • belonging_room:行所在机房的名称 注:请将此信息添加到机房信息表中。 机架信息 以下是机架信息表的示例。 表11. 机架信息表

rack name column belonging_row
rack1 1 row1

请在以下字段中输入至少一个机架信息条目: • name:机架名称(在同一个机房内必须是唯一的) • column:机架位置列,也称为机架编号(必须是正整数,并且在同一行中必须是唯一的) • belonging_row:机架所在行的名称 注:请将此信息添加到行信息表中。 机箱信息 如果集群中有机箱,请输入机箱信息。 以下是机箱信息表的示例。

表12. 机箱信息表

chassis name belonging_rack location_u_in_rack location_u_in_rack
chassis1 rack1 7 7X20

该表中的字段说明如下: • name:机箱名称(在同一个机房内必须是唯一的) • belonging_rack:机架位置名称(必须使用机架信息表中配置的名称) • location_u_in_rack:机箱基座在机架中的位置(单位:U)。在标准机柜中,该值应该在1 到 42 之间。例如,机箱基座位于5U。 • machine_type:机箱类型 节点信息 在节点信息表中输入集群中所有节点的信息。由于宽度原因,示例节点信息表拆分为两个部分进 行显示。 表13. 节点信息表(第1 部分)

node name node-type immip hostip machine_type ipmi_user
head head 10.240.212.13 127.0.0.1 7X58

表14. 节点信息表(第2 部分)

ipmi_pwd belonging_rack belonging_chassis location_u groups
rack1 2 login

字段的描述如下: • name:节点主机名(不需要域名) • nodetype:head 表示管理节点;login 表示登录节点;compute 表示计算节点。 • immip:节点BMC 系统的IP 地址 • hostip:主机网络上的节点的IP 地址 • machine_type:节点的产品名称 • ipmi_user:节点的XCC(BMC)帐户 • ipmi_pwd:节点的XCC(BMC)密码 • belonging_rack:节点所在机架的名称(需要将配置的名称添加到机架信息表中)。如果节点属于机箱,请将此字段留空。 • belonging_chassis:节点所在机箱的名称(需要将配置的名称添加到机箱信息表中)。如果节点属于机架,请将此字段留空。 • location_u:节点位置。如果节点位于机箱中,请输入节点所在的机箱插槽。如果节点位于机架 中,请输入节点基座在机架中的位置(单位:U)。 • groups:节点位置逻辑组的名称。一个节点可以属于多个逻辑组。组名应该用“;”分隔。请在逻辑组信息表中配置逻辑组名称。

配置通用资源 该模块仅在调度器为slurm 时执行。执行以下操作之一来配置通用资源: • 如果默认没有配置通用资源,而GPU 资源位于集群中且需要计费,请执行如下命令: cp /etc/lico/gres.csv.example /etc/lico/gres.csv • 如果为Slurm 配置了其他通用资源,并且需要对这些资源进行计费,请执行以下命令: vi /etc/lico/gres.csv 注:为确保历史计费信息的准确性,已从gres.csv 中删除的通用资源仍会保留在系统数据库中。 通用资源信息 以下是通用资源信息表的示例:

code display_name unit
gpu GPU card

在以下字段中输入至少一项通用资源信息: • code:此代码应与调度器中定义的通用资源类型一致。如果已经按照本文档安装了LiCO,则 可以根据slurm.conf 中的GresTypes 配置填写该代码。 • display_name:LiCO 系统中显示的通用资源名称。建议使用有意义的显示名称。 • unit:资源单位。

集群服务列表 注:在安装节点列中,M 代表“管理节点”,L 代表“登录节点”,C 代表“计算节点”。 表15. 集群服务列表

软件 组件 服务 默认端口 安装节点
lico lico-core lico 18080/tcp M
lico-confluent-proxy 18081/tcp M
lico-vnc-proxy lico-vnc-proxy 18082/tcp、18083/tcp M
lico-vnc-mond lico-vnc-mond C
lico-sms-agent lico-sms-agent 18092/tcp M
lico-wechat-agent lico-wechat-agent 18090/tcp M
lico-mail-agent lico-mail-agent 18091/tcp M
lico-file-manager lico-file-manager 18085/tcp M
lico-async-task lico-async-task-proxy 18086/tcp M、L
lico-async-task 18084/tcp M、L
lico依赖项 nginx nginx 80/tcp、443/tcp L、M
rabbitmq rabbitmq-server 5762/tcp M
mariadb mariadb 3306/tcp
confluent confluent 4005/tcp、13001/tcp M
influxdb influxdb 8086/tcp、8088/tcp M
ldap slapd 389/tcp、636/tcp M
nslcd M、C、L
集群 nfs nfs 111/tcp、111/udp、
2049/tcp、2049/udp
M
chrony chronyd M
slurm munge M、C
slurmctld 6817/tcp M
slurmd 6818/tcp C
icinga2 icinga2 5665/tcp、5665/udp M、C、L
dns named 53/udp M
dhcp dhcpd 67/udp M

配置LiCO 组件

有关配置LiCO 的更多信息,请参阅:
https://hpc.lenovo.com/lico/downloads/7.0/configuration/host/configuration.html
lico-portal
为了防止https 和NGINX Web 服务器之间的冲突,可能需要修改安装了lico-portal 模块(该模
块为外部Web 服务提供不同的端口)的节点的一些路径文件。
/etc/nginx/nginx.conf
可编辑/etc/nginx/nginx.conf,将端口更改为8080:
listen 8080 default_server;
listen [::]:8080 default_server;
要隐藏服务器版本信息,请修改/etc/nginx/nginx.conf,将server_tokens 关闭:
http{
......
sendfile on;
server_tokens off;
……
}
/etc/nginx/conf.d/https.conf
可编辑/etc/nginx/conf.d/https.conf,将默认https 端口443 更改为另一个端口:
listen <port> ssl http2;
注:请确保该端口未被其他应用程序使用且未被防火墙阻止。
/etc/nginx/conf.d/sites-available/lico.conf
可编辑/etc/nginx/conf.d/sites-available/lico.conf,将第一行替换为以下内容:
set $lico_host 127.0.0.1;
注:如果lico-portal 无法运行,可将127.0.0.1 更改为管理节点的IP 地址。
/etc/lico/portal.conf
可编辑/etc/lico/portal.conf,添加自定义快捷链接。请参阅/etc/lico/portal.conf.example 以了解配置格式。

初始化系统

初始化LiCO:
lico init

初始化云工具

初始化云工具:
lico cloudtool import -n 'CVAT' -c \
cvat -t cvat -p job_queue,cores_per_node,username,password,ram_size,share_dir
lico cloudtool import -n 'Jupyter Notebook' -c jupyter -t jupyter -p \
image_path,jupyter_cmd,password,job_queue,cores_per_node,gpu_per_node,check_timeout,run_time
lico cloudtool import -n 'RStudio Server' -c \
rstudio -t rstudio -p job_queue,cores_per_node,gpu_per_node,password,run_time
lico cloudtool import -n 'TigerVNC' -c \
tigervnc -t tigervnc -p job_queue,cores_per_node,gpu_per_node,runtime_id,password,run_time

初始化用户 完成以下步骤以初始化LiCO 用户:

步骤1. (可选)要使用LDAP 管理用户,请在LiCO 配置文件/etc/lico/lico.ini.d/user.ini 中找
到以下配置并将值更改为“true”:
USE_LIBUSER = false
步骤2. (可选)向LDAP 添加具有管理员权限的新用户:
luseradd <HPC_ADMIN_USERNAME> -P <HPC_ADMIN_PASSWORD>
nodeshell all "su - <HPC_ADMIN_USERNAME> -c whoami"
步骤3. 将用户导入LiCO:
lico import_user -u <HPC_ADMIN_USERNAME> -r admin

第6 章启动并登录到LiCO

启动LiCO

步骤1. 在登录节点上启动LiCO 相关服务:
nodeshell login lico-service-tool enable
nodeshell login lico-service-tool start
步骤2. 在管理节点上启动LiCO 相关服务:
lico-service-tool enable
lico-service-tool start