[关闭]
@Yalei-SONG 2019-01-27T09:15:30.000000Z 字数 4722 阅读 285

参考链接

https://www.ibm.com/developerworks/cn/linux/l-11sysadtips/index.html?mhq=slurm&mhsrc=ibmsearch_a
比较老的资料鸟哥的私房菜
https://www.linuxidc.com/Linux/2016-06/132375.htm
https://www.cnblogs.com/liwanliangblog/p/9194244.html

virtualbox新建CentOS 7虚拟机

注意安装所需kener-devel模块,并重启,再执行VirtualBox提示的/sbin/vbconfig程序。
虚拟机的上网方式选择Host-only Adapter模式。
安装系统时,记得打开网络。
修改系统的/etc/hostname文件来修改主机名与域名。

SSH

https://blog.csdn.net/universe_hao/article/details/52296811

NFS

(也有用autofs而不用mount来挂载文件系统的,但我感觉用autofs没有优势)
https://blog.csdn.net/dongfengkuayue/article/details/27386067
https://linux.101hacks.com/unix/rpc-port-mapper-failure/
https://blog.csdn.net/brad_chen/article/details/50293747

开启rpcbind与nfs,设置为开机启动。
关闭防火墙firewalld。
修改/etc/exports,增加共享出去的文件夹。
/home/nfs-share 192.168.56.0/24(rw)
注意防火墙firewalld会阻止nfs的端口,可以开放对应端口。
用rpcinfo -p 本地IPadd查询所需端口
portmap(111端口),nfs(2049端口),nfs挂载端口(892端口),其中111和892是tcp,udp都用。
注意,20048端口也要加。
添加

firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
Notic that we can also change the zone of the internal interface
https://yq.aliyun.com/articles/617169
https://blog.csdn.net/weixin_40658000/article/details/78708375
重新载入

firewall-cmd --reload

加载nfs系统
mount -t nfs master.cluster:/home /home

NIS

参考此处的SELinux设置(由于是单向同步,且共享了/home,其实可以跳过此步骤)
https://www.server-world.info/en/note?os=CentOS_7&p=nis&f=1

注意checkmodule的安装,
yum install *audit2allow

具体可以按照这个来设置,注意,不需要设置slave端,只需要server和client。
https://blog.csdn.net/younger_china/article/details/53130780

OpenMPI

export PATH="PATH:/usr/local/openmpi/bin"
export LDLIBRARYPATH="LD_LIBRARY_PATH:/usr/local/openmpi/lib/

SSH 免密码登录

http://www.cnblogs.com/shuaiwhu/archive/2010/08/24/2065091.html

PDSH 配置

http://kumu-linux.github.io/blog/2013/06/19/pdsh/

munge安装时,记得安装munge-devel

MySQL

https://blog.csdn.net/z13615480737/article/details/78906598
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
yum install
yum update
yum install mysql-community-client mysql-community-server mysql-community-devel
alter user 'root'@'localhost' identified by 'Root!!2018';

flush privileges

在这里,主要注意开放权限给本地的root用户和远程的slurm用户,其实这里指的是MySQL中的用户,并非系统中的用户。
本应该只开放
特别注意,新版本的MySQL中,grant命令不再具有创见用户的功能,需将原来的一行命令改为两行。
create user slurm@localhost identified by 'PASSWD';
grant all privileges on . to slurm@localhost;

create user slurm@node1 identified by 'PASSWD';
grant all privileges on . to slurm@node1;
select user,host from mysql.user;

create user slurm@node2 identified by 'PASSWD';
grant all privileges on . to slurm@node2;
select user,host from mysql.user;

create user slurm@node3 identified by 'PASSWD';
grant all privileges on . to slurm@node3;
select user,host from mysql.user;

create user slurm@node4 identified by 'PASSWD';
grant all privileges on . to slurm@node4;
select user,host from mysql.user;

create user slurm@node5 identified by 'PASSWD';
grant all privileges on . to slurm@node5;
select user,host from mysql.user;

create user slurm@node6 identified by 'PASSWD';
grant all privileges on . to slurm@node6;
select user,host from mysql.user;

create user slurm@node7 identified by 'PASSWD';
grant all privileges on . to slurm@node7;
select user,host from mysql.user;

create user slurm@node8 identified by 'PASSWD';
grant all privileges on . to slurm@node8;
select user,host from mysql.user;

配置文件:/etc/my.cnf
日志文件:/var/log/var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service
socket文件:/var/run/mysqld/mysqld.pid

SLURM

./configure --prefix=/usr/local/slurm/18.08.3 --sysconfdir=/usr/local/slurm/18.08.3/etc --localstatedir=/var --enable-pam --enable-memory-leak-debug --enable-front-end --enable-salloc-kill-cmd --enable-simulator --enable-multiple-slurmd --with-pam_dir=/lib64 --with-zlib --with-rrdtool --with-mysql_config=/usr/bin/mysql_config-64 --with-munge=/usr/local/globle/softs/munge/0.5.12/ --with-ssl --with-libcurl

注意mysql和munge的路径,munge要用源码安装一次,需要用其目录下的文件来编译slurm
竟然需要去掉--with-mysql_config=/usr/bin/mysql_config-64选项才能找到mysql_config,不指定的时候反而会自己搜索到。
./configure --prefix=/usr/local/slurm/18.08.3 --sysconfdir=/usr/local/slurm/18.08.3/etc --localstatedir=/var --enable-pam --enable-memory-leak-debug --enable-salloc-kill-cmd --enable-simulator --enable-multiple-slurmd --with-pam_dir=/lib64 --with-zlib --with-rrdtool --with-munge=/usr/local/munge/0.5.13/ --with-ssl --with-libcurl

make
make install
useradd slurm

#

slurm.conf
slurmdbd.conf
cgroup

#

上述文件有一个将密码

alias matlab='matlab -nodisplay -nodesktop -nosplash -nojvm'
export PATH=${PATH}:/usr/local/slurm/18.08.3/sbin:/usr/local/slurm/18.08.3/bin

#

touch /var/log/slurmd.log
chmod -600 slurm /var/log/slurmd.log
chmod 600 /var/log/slurmd.log
mkdir /var/spool/slurm
mkdir /var/spool/slurm/d
chown slurm /var/spool/slurm/d
chgrp slurm /var/spool/slurm/d
chmod 700 -R slurm /var/spool/slurm/d
chmod 700 -R /var/spool/slurm/d
chown root slurmd.log
chgrp root slurmd.log
chown root -R d
chgrp root -R d

安全相关

密码生成

https://www.cnblogs.com/kerrycode/p/6537175.html

密码限制

https://www.cnblogs.com/miaoxg/p/5165355.html

SSH配置

https://cloud.tencent.com/developer/article/1028243

yum安装指定版本软件

http://ju.outofmemory.cn/entry/117435

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注