first commit

This commit is contained in:
baol 2024-12-17 14:40:01 +08:00
commit 37ef0c6ab5
58 changed files with 1565 additions and 0 deletions

17
Rinstall.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
echo "set time zone"
# update indices
sudo apt update -qq
# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr
# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
sudo apt-get install r-base -y

138
_bashrc Executable file
View File

@ -0,0 +1,138 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
alias ps="ps -xv"
function newhuser(){
echo “create new user: “
echo “”
echo "sudo useradd -s /bin/bash -d /users/$1/ -m -G huser $1"
sudo useradd -s /bin/bash -d /users/$1/ -m -G huser $1
echo “sudo mkdir -p /scratch/$1”
sudo mkdir -p /scratch/$1
echo “sudo chown $1: /scratch/$1”
sudo chown $1: /scratch/$1
echo sudo chmod -R 750 /scratch/$1
sudo chmod -R 750 /scratch/$1
echo “”
echo “PASSWROD: ”
echo "sudo passwd $1"
sudo passwd $1
}
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls -lG --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

28
bak/s3.munge.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# for SERVER only
echo sudo rm -rf /etc/munge/munge.key
sudo rm -rf /etc/munge/munge.key
echo sudo mungekey
sudo mungekey
echo ""
echo "copy munge to home folder"
echo "sudo cp /etc/munge/munge.key ~/config/files/munge.key"
sudo cp /etc/munge/munge.key ~/config/files/munge.key
echo ""
echo "change owner"
echo "sudo chown munge:munge /etc/munge/munge.key"
sudo chown munge:munge /etc/munge/munge.key
echo ""
echo "start munge"
echo "sudo /etc/init.d/munge start"
sudo /etc/init.d/munge start
echo ""
echo "===check status==="
echo "systemctl status munge"
systemctl status munge

9
cp2node.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#echo "scp -i ~/.ssh/id_rsa -r ~/config laoban@stor:~/"
#scp -i ~/.ssh/id_rsa -r ~/config laoban@stor:~/
echo "scp -i ~/.ssh/id_rsa -r ~/config laoban@cnx:~/"
seq 8 | xargs -I XX scp -i ~/.ssh/id_rsa -r ~/config laoban@cn0XX:~/
echo scp -i ~/.ssh/id_rsa -r ~/config laoban@udesk:~/
scp -i ~/.ssh/id_rsa -r ~/config laoban@udesk:~/

5
cpfnode.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
echo scp -r laoban@10.0.1.100:~/config ~/
scp -r laoban@10.0.1.100:~/config ~/

37
files/bak.hosts.txt Executable file
View File

@ -0,0 +1,37 @@
# ==The nodes IB NETWORK =======
10.0.2.150 stor
10.0.2.150 xnode
10.0.2.151 cn01
10.0.2.152 cn02
10.0.2.153 cn03
10.0.2.154 cn04
10.0.2.155 cn05
10.0.2.156 cn06
10.0.2.157 cn07
10.0.2.158 cn08
# ==The nodes ETHERNET PORT 1=======
10.0.1.100 estor
10.0.1.100 exnode
10.0.1.101 ecn01
10.0.1.102 ecn02
10.0.1.103 ecn03
10.0.1.104 ecn04
10.0.1.105 ecn05
10.0.1.106 ecn06
10.0.1.107 ecn07
10.0.1.108 ecn08
# ==The nodes ETHERNET PORT 2=======
10.0.1.150 e2stor
10.0.1.150 e2xnode
10.0.1.151 e2cn01
10.0.1.152 e2cn02
10.0.1.153 e2cn03
10.0.1.154 e2cn04
10.0.1.155 e2cn05
10.0.1.156 e2cn06
10.0.1.157 e2cn07
10.0.1.158 e2cn08

2
files/bash.txt Normal file
View File

@ -0,0 +1,2 @@
export PATH=$PATH:/opt/slurm/bin:/opt/slurm/sbin

1
files/defaultdomain Executable file
View File

@ -0,0 +1 @@
hpc.shud

16
files/exports Executable file
View File

@ -0,0 +1,16 @@
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/volume/data 10.0.1.1/24(rw,sync,no_root_squash,no_subtree_check)
/volume/users 10.0.1.1/24(rw,sync,no_root_squash,no_subtree_check)
/volume/scratch 10.0.1.1/24(rw,sync,no_root_squash,no_subtree_check)
/opt 10.0.1.1/24(rw,sync,no_root_squash,no_subtree_check)

5
files/fstab.cn.txt Executable file
View File

@ -0,0 +1,5 @@
xnode:/opt /opt nfs nfsvers=3 0 0
stor:/volume/users /users nfs nfsvers=3 0 0
stor:/volume/data /data nfs nfsvers=3 1 0
stor:/volume/scratch /scratch nfs nfsvers=3 0 0

13
files/fstab.txt Executable file
View File

@ -0,0 +1,13 @@
stor:/volume/data /data nfs default,rw,_netdev 0 0
stor:/volume/users /users nfs default,rw,_netdev 0 0
stor:/volume/scratch /scratch nfs default,rw,_netdev 0 0
#nas:/ /nas/ nfs nfsvers=3,noauto 0 0
nas:/volume1/SpatialData /nas/SpatialData nfs nfsvers=3,rw,user,noauto 0 0
nas:/volume1/ForcingData /nas/ForcingData nfs nfsvers=3,rw,user,noauto 0 0
nas:/volume1/Shared /nas/Shared nfs nfsvers=3,rw,user,noauto 0 0
nas:/volume1/Download /nas/Download nfs nfsvers=3,rw,user,noauto 0 0
xnode:/opt /opt nfs default,rw,_netdev 0 0

25
files/hosts.txt Executable file
View File

@ -0,0 +1,25 @@
10.0.1.11 udesk
# ==The nodes IB NETWORK =======
10.0.2.100 stor
10.0.2.100 xnode
10.0.2.101 cn01
10.0.2.102 cn02
10.0.2.103 cn03
10.0.2.104 cn04
10.0.2.105 cn05
10.0.2.106 cn06
10.0.2.107 cn07
10.0.2.108 cn08
# ==The nodes ETHERNET PORT 1=======
10.0.1.100 estor
10.0.1.100 exnode
10.0.1.101 ecn01
10.0.1.102 ecn02
10.0.1.103 ecn03
10.0.1.104 ecn04
10.0.1.105 ecn05
10.0.1.106 ecn06
10.0.1.107 ecn07
10.0.1.108 ecn08

BIN
files/munge.key Executable file

Binary file not shown.

39
files/nis Executable file
View File

@ -0,0 +1,39 @@
#
# /etc/defaults/nis Optional configuration settings for the NIS programs.
#
#
# The following two variables are still used in the init script, but
# ignored by systemd. See `nis.debian.howto` in the documentation
# directory for more information.
#
# Are we a NIS server and if so what kind (values: false, slave, master)?
NISSERVER=master
# Are we a NIS client?
NISCLIENT=false
# Location of the master NIS password file (for yppasswdd).
# If you change this make sure it matches with /var/yp/Makefile.
YPPWDDIR=/etc
# Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK
# fields are passed with -e to yppasswdd, see it's manpage.
# Possible values: "chsh", "chfn", "chsh,chfn"
YPCHANGEOK=chsh
# NIS master server. If this is configured on a slave server then ypinit
# will be run each time NIS is started.
NISMASTER=
# Additional options to be given to ypserv when it is started.
YPSERVARGS=
# Additional options to be given to ypbind when it is started.
YPBINDARGS=
# Additional options to be given to yppasswdd when it is started. Note
# that if -p is set then the YPPWDDIR above should be empty.
YPPASSWDDARGS=
# Additional options to be given to ypxfrd when it is started.
YPXFRDARGS=

39
files/nis.client Executable file
View File

@ -0,0 +1,39 @@
#
# /etc/defaults/nis Optional configuration settings for the NIS programs.
#
#
# The following two variables are still used in the init script, but
# ignored by systemd. See `nis.debian.howto` in the documentation
# directory for more information.
#
# Are we a NIS server and if so what kind (values: false, slave, master)?
NISSERVER=false
# Are we a NIS client?
NISCLIENT=true
# Location of the master NIS password file (for yppasswdd).
# If you change this make sure it matches with /var/yp/Makefile.
YPPWDDIR=/etc
# Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK
# fields are passed with -e to yppasswdd, see it's manpage.
# Possible values: "chsh", "chfn", "chsh,chfn"
YPCHANGEOK=chsh
# NIS master server. If this is configured on a slave server then ypinit
# will be run each time NIS is started.
NISMASTER=
# Additional options to be given to ypserv when it is started.
YPSERVARGS=
# Additional options to be given to ypbind when it is started.
YPBINDARGS=
# Additional options to be given to yppasswdd when it is started. Note
# that if -p is set then the YPPWDDIR above should be empty.
YPPASSWDDARGS=
# Additional options to be given to ypxfrd when it is started.
YPXFRDARGS=

39
files/nis.server Executable file
View File

@ -0,0 +1,39 @@
#
# /etc/defaults/nis Optional configuration settings for the NIS programs.
#
#
# The following two variables are still used in the init script, but
# ignored by systemd. See `nis.debian.howto` in the documentation
# directory for more information.
#
# Are we a NIS server and if so what kind (values: false, slave, master)?
NISSERVER=master
# Are we a NIS client?
NISCLIENT=false
# Location of the master NIS password file (for yppasswdd).
# If you change this make sure it matches with /var/yp/Makefile.
YPPWDDIR=/etc
# Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK
# fields are passed with -e to yppasswdd, see it's manpage.
# Possible values: "chsh", "chfn", "chsh,chfn"
YPCHANGEOK=chsh
# NIS master server. If this is configured on a slave server then ypinit
# will be run each time NIS is started.
NISMASTER=
# Additional options to be given to ypserv when it is started.
YPSERVARGS=
# Additional options to be given to ypbind when it is started.
YPBINDARGS=
# Additional options to be given to yppasswdd when it is started. Note
# that if -p is set then the YPPWDDIR above should be empty.
YPPASSWDDARGS=
# Additional options to be given to ypxfrd when it is started.
YPXFRDARGS=

7
files/nodeenv.sh Executable file
View File

@ -0,0 +1,7 @@
# for update env variables for comput node.
export PATH="$PATH:/opt/R/bin/"
export PATH="$PATH:/opt/bin/"
export PATH="$PATH:/opt/Modules/bin"

31
files/on.yaml Executable file
View File

@ -0,0 +1,31 @@
# This is the network config written by 'subiquity'
network:
ethernets:
enp94s0f0:
dhcp4: no
addresses: [10.0.1.101/24]
routes:
- to: 10.0.1.1
nameservers:
addresses: [159.226.8.6,159.226.8.7]
optional: true
enp94s0f1:
dhcp4: no
addresses: [10.0.1.151/24]
routes:
- to: default
via: 10.0.1.1
nameservers:
addresses: [159.226.8.6,159.226.8.7]
optional: true
ibp24s0:
dhcp4: no
dhcp6: no
addresses: [10.0.2.101/24]
optional: true
ibp24s0d1:
dhcp4: no
dhcp6: no
addresses: [10.0.2.151/24]
optional: true
version: 2

154
files/slurm.conf Executable file
View File

@ -0,0 +1,154 @@
#
# Example slurm.conf file. Please run configurator.html
# (in doc/html) to build a configuration file customized
# for your environment.
#
#
# slurm.conf file generated by configurator.html.
# Put this file on all nodes of your cluster.
# See the slurm.conf man page for more information.
#
ClusterName=shudHPC
SlurmctldHost=xnode
#SlurmctldHost=
#
#DisableRootJobs=NO
#EnforcePartLimits=NO
#Epilog=
#EpilogSlurmctld=
#FirstJobId=1
#MaxJobId=67043328
#GresTypes=
#GroupUpdateForce=0
#GroupUpdateTime=600
#JobFileAppend=0
#JobRequeue=1
#JobSubmitPlugins=lua
#KillOnBadExit=0
#LaunchType=launch/slurm
#Licenses=foo*4,bar
#MailProg=/bin/mail
#MaxJobCount=10000
#MaxStepCount=40000
#MaxTasksPerNode=512
MpiDefault=none
#MpiParams=ports=#-#
#PluginDir=
#PlugStackConfig=
#PrivateData=jobs
ProctrackType=proctrack/cgroup
#Prolog=
#PrologFlags=
#PrologSlurmctld=
#PropagatePrioProcess=0
#PropagateResourceLimits=
#PropagateResourceLimitsExcept=
#RebootProgram=
ReturnToService=1
SlurmctldPidFile=/var/run/slurmctld.pid
SlurmctldPort=6817
SlurmdPidFile=/var/run/slurmd.pid
SlurmdPort=6818
SlurmdSpoolDir=/var/spool/slurmd
#SlurmUser=slurm
#SlurmdUser=root
#SrunEpilog=
#SrunProlog=
StateSaveLocation=/var/spool/slurmctld
SwitchType=switch/none
#TaskEpilog=
TaskPlugin=task/affinity
#TaskProlog=
#TopologyPlugin=topology/tree
#TmpFS=/tmp
#TrackWCKey=no
#TreeWidth=
#UnkillableStepProgram=
#UsePAM=0
#
#
# TIMERS
#BatchStartTimeout=10
#CompleteWait=0
#EpilogMsgTime=2000
#GetEnvTimeout=2
#HealthCheckInterval=0
#HealthCheckProgram=
InactiveLimit=0
KillWait=30
#MessageTimeout=10
#ResvOverRun=0
MinJobAge=300
#OverTimeLimit=0
SlurmctldTimeout=120
SlurmdTimeout=300
#UnkillableStepTimeout=60
#VSizeFactor=0
Waittime=0
#
#
# SCHEDULING
#DefMemPerCPU=0
#MaxMemPerCPU=0
#SchedulerTimeSlice=30
SchedulerType=sched/backfill
SelectType=select/cons_tres
SelectTypeParameters=CR_Core
#
#
# JOB PRIORITY
#PriorityFlags=
#PriorityType=priority/basic
#PriorityDecayHalfLife=
#PriorityCalcPeriod=
#PriorityFavorSmall=
#PriorityMaxAge=
#PriorityUsageResetPeriod=
#PriorityWeightAge=
#PriorityWeightFairshare=
#PriorityWeightJobSize=
#PriorityWeightPartition=
#PriorityWeightQOS=
#
#
# LOGGING AND ACCOUNTING
#AccountingStorageEnforce=0
#AccountingStorageHost=
#AccountingStoragePass=
#AccountingStoragePort=
AccountingStorageType=accounting_storage/slurmdbd
#AccountingStorageUser=
#AccountingStoreFlags=
#JobCompHost=
#JobCompLoc=
#JobCompPass=
#JobCompPort=
JobCompType=jobcomp/none
#JobCompUser=
#JobContainerType=job_container/none
JobAcctGatherFrequency=30
JobAcctGatherType=jobacct_gather/none
SlurmctldDebug=info
SlurmctldLogFile=/var/log/slurmctld.log
SlurmdDebug=info
SlurmdLogFile=/var/log/slurmd.log
#SlurmSchedLogFile=
#SlurmSchedLogLevel=
#DebugFlags=
#
#
# POWER SAVE SUPPORT FOR IDLE NODES (optional)
#SuspendProgram=
#ResumeProgram=
#SuspendTimeout=
#ResumeTimeout=
#ResumeRate=
#SuspendExcNodes=
#SuspendExcParts=
#SuspendRate=
#SuspendTime=
#
#
# COMPUTE NODES
NodeName=cn[01-16] CPUs=40 RealMemory=192000 Sockets=2 CoresPerSocket=20 ThreadsPerCore=1 State=IDLE
PartitionName=suan Nodes=cn[01-16] Default=YES MaxTime=14400 State=UP

21
files/slurmctld.service Normal file
View File

@ -0,0 +1,21 @@
[Unit]
Description=Slurm controller daemon
After=network-online.target munge.service
Wants=network-online.target
ConditionPathExists=/opt/slurm/etc/slurm.conf
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/slurmctld
ExecStart=/opt/slurm/sbin/slurmctld -D -s $SLURMCTLD_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
LimitNOFILE=65536
TasksMax=infinity
# Uncomment the following lines to disable logging through journald.
# NOTE: It may be preferable to set these through an override file instead.
#StandardOutput=null
#StandardError=null
[Install]
WantedBy=multi-user.target

25
files/slurmd.service Normal file
View File

@ -0,0 +1,25 @@
[Unit]
Description=Slurm node daemon
After=munge.service network-online.target remote-fs.target
Wants=network-online.target
#ConditionPathExists=/opt/slurm/etc/slurm.conf
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/slurmd
ExecStart=/opt/slurm/sbin/slurmd -D -s $SLURMD_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
LimitNOFILE=131072
LimitMEMLOCK=infinity
LimitSTACK=infinity
Delegate=yes
TasksMax=infinity
# Uncomment the following lines to disable logging through journald.
# NOTE: It may be preferable to set these through an override file instead.
#StandardOutput=null
#StandardError=null
[Install]
WantedBy=multi-user.target

21
files/slurmdbd.service Normal file
View File

@ -0,0 +1,21 @@
[Unit]
Description=Slurm DBD accounting daemon
After=network-online.target munge.service mysql.service mysqld.service mariadb.service
Wants=network-online.target
ConditionPathExists=/opt/slurm/etc/slurmdbd.conf
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/slurmdbd
ExecStart=/opt/slurm/sbin/slurmdbd -D -s $SLURMDBD_OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
LimitNOFILE=65536
TasksMax=infinity
# Uncomment the following lines to disable logging through journald.
# NOTE: It may be preferable to set these through an override file instead.
#StandardOutput=null
#StandardError=null
[Install]
WantedBy=multi-user.target

18
files/slurmrestd.service Normal file
View File

@ -0,0 +1,18 @@
[Unit]
Description=Slurm REST daemon
After=network-online.target munge.service slurmctld.service
Wants=network-online.target
ConditionPathExists=/opt/slurm/etc/slurm.conf
[Service]
Type=simple
EnvironmentFile=-/etc/sysconfig/slurmrestd
# Default to local auth via socket
ExecStart=/opt/slurm/sbin/slurmrestd $SLURMRESTD_OPTIONS unix:/opt/slurm/com/slurmrestd.socket
# Uncomment to enable listening mode
#Environment="SLURM_JWT=daemon"
#ExecStart=/opt/slurm/sbin/slurmrestd $SLURMRESTD_OPTIONS 0.0.0.0:6820
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

19
files/xnode.yaml Executable file
View File

@ -0,0 +1,19 @@
# This is the network config written by 'subiquity'
network:
ethernets:
enp94s0f0np0:
dhcp4: no
addresses: [210.72.80.22/24]
routes:
- to: default
via: 210.72.80.254
nameservers:
addresses: [159.226.8.6,159.226.8.7]
optional: true
enp94s0f1np1:
dhcp4: no
addresses: [10.0.1.30/26]
routes:
- to: 10.0.1.1
optional: true
version: 2

14
files/yp.conf Executable file
View File

@ -0,0 +1,14 @@
#
# yp.conf Configuration file for the ypbind process. You can define
# NIS servers manually here if they can't be found by
# broadcasting on the local net (which is the default).
#
# See the manual page of ypbind for the syntax of this file.
#
# IMPORTANT: For the "ypserver", use IP addresses, or make sure that
# the host is in /etc/hosts. This file is only interpreted
# once, and if DNS isn't reachable yet the ypserver cannot
# be resolved and ypbind won't ever bind to the server.
# ypserver ypserver.network.com
ypserver xnode

18
files/ypserv.securenets Executable file
View File

@ -0,0 +1,18 @@
#
# securenets This file defines the access rights to your NIS server
# for NIS clients. This file contains netmask/network
# pairs. A clients IP address needs to match with at least
# one of those.
#
# One can use the word "host" instead of a netmask of
# 255.255.255.255. Only IP addresses are allowed in this
# file, not hostnames.
#
# Always allow access for localhost, IPv4 and IPv6
255.0.0.0 127.0.0.0
host ::1
# This lines gives access to everybody. PLEASE ADJUST!
#0.0.0.0 0.0.0.0
255.255.255.192 10.0.1.0
::/0

18
ib.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# +++++++++++++++++++++++++++++++++++++++
echo sudo apt update
sudo apt update
echo sudo apt install -y ibverbs-utils infiniband-diags
sudo apt install -y ibverbs-utils infiniband-diag net-tools
echo sudo /etc/init.d/openibd restart
sudo /etc/init.d/openibd restart
ofed_info -s
ibdev2netdev
ip a

9
netoff.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
echo sudo cp ~/off.yaml /etc/netplan/00-installer-config.yaml
sudo cp ~/off.yaml /etc/netplan/00-installer-config.yaml
echo sudo netplan apply
sudo netplan apply
sleep 5
ping -c4 xnode

9
neton.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
echo sudo cp ~/on.yaml /etc/netplan/00-installer-config.yaml
sudo cp ~/on.yaml /etc/netplan/00-installer-config.yaml
echo sudo netplan apply
sudo netplan apply
sleep 5
ping -c4 210.72.80.22

28
nis.client.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
echo sudo cp ~/config/nis/defaultdomain /etc/defaultdomain
sudo cp ~/config/nis/defaultdomain /etc/defaultdomain
# 编辑/etc/default/nis将NISCLIENT=false改为true
echo sudo cp ~/config/nis/nis.client /etc/default/nis
sudo cp ~/config/nis/nis.client /etc/default/nis
# 编辑/etc/yp.conf指定nis服务器
echo sudo cp ~/config/nis/yp.conf /etc/yp.conf
sudo cp ~/config/nis/yp.conf /etc/yp.conf
# 编辑/etc/nsswitch.conf注释原有的passwd、shadow、group增加以下内容
echo sudo cp ~/config/nis/nsswitch.conf /etc/nsswitch.conf
sudo cp ~/config/nis/nsswitch.conf /etc/nsswitch.conf
sudo systemctl stop ypbind
echo sudo systemctl start ypbind
sudo systemctl start ypbind
echo sudo systemctl enable ypbind
sudo systemctl enable ypbind
sleep 3
echo sudo systemctl status ypbind
sudo systemctl status ypbind

38
nis.server.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
# 安装和启动rpcbind, nis
echo sudo apt-get install rpcbind nis -y
sudo apt-get install rpcbind nis -y
echo systemctl enable rpcbind
sudo systemctl enable rpcbind
echo systemctl start rpcbind
sudo systemctl start rpcbind
# 设置nis域名
echo sudp cp ~/config/nis/defaultdomain /etc/defaultdomain
sudp cp ~/config/nis/defaultdomain /etc/defaultdomain
# 编辑/etc/default/nis将NISCLIENT=false改为true
echo "sudo cp ~/config/nis/nis.server /etc/default/nis"
sudo cp ~/config/nis/nis.server /etc/default/nis
# 编辑/etc/yp.conf指定nis服务器
echo sudo cp ~/config/nis/yp.conf /etc/yp.conf
sudo cp ~/config/nis/yp.conf /etc/yp.conf
# NIS 访问IP
echo "sudo cp ~/config/nis/ypserv.securenets /etc/ypserv.securenets"
sudo cp ~/config/nis/ypserv.securenets /etc/ypserv.securenets
# 初始化数据库 #出现提示按Ctrl+D或回车
echo sudo /usr/lib/yp/ypinit -m
sudo /usr/lib/yp/ypinit -m
# 启动ypserv
echo systemctl start ypserv
sudo systemctl start ypserv
echo systemctl enable ypserv
sudo systemctl enable ypserv

1
nis/defaultdomain Executable file
View File

@ -0,0 +1 @@
hpc.shud

39
nis/nis Executable file
View File

@ -0,0 +1,39 @@
#
# /etc/defaults/nis Optional configuration settings for the NIS programs.
#
#
# The following two variables are still used in the init script, but
# ignored by systemd. See `nis.debian.howto` in the documentation
# directory for more information.
#
# Are we a NIS server and if so what kind (values: false, slave, master)?
NISSERVER=master
# Are we a NIS client?
NISCLIENT=false
# Location of the master NIS password file (for yppasswdd).
# If you change this make sure it matches with /var/yp/Makefile.
YPPWDDIR=/etc
# Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK
# fields are passed with -e to yppasswdd, see it's manpage.
# Possible values: "chsh", "chfn", "chsh,chfn"
YPCHANGEOK=chsh
# NIS master server. If this is configured on a slave server then ypinit
# will be run each time NIS is started.
NISMASTER=
# Additional options to be given to ypserv when it is started.
YPSERVARGS=
# Additional options to be given to ypbind when it is started.
YPBINDARGS=
# Additional options to be given to yppasswdd when it is started. Note
# that if -p is set then the YPPWDDIR above should be empty.
YPPASSWDDARGS=
# Additional options to be given to ypxfrd when it is started.
YPXFRDARGS=

39
nis/nis.client Executable file
View File

@ -0,0 +1,39 @@
#
# /etc/defaults/nis Optional configuration settings for the NIS programs.
#
#
# The following two variables are still used in the init script, but
# ignored by systemd. See `nis.debian.howto` in the documentation
# directory for more information.
#
# Are we a NIS server and if so what kind (values: false, slave, master)?
NISSERVER=false
# Are we a NIS client?
NISCLIENT=true
# Location of the master NIS password file (for yppasswdd).
# If you change this make sure it matches with /var/yp/Makefile.
YPPWDDIR=/etc
# Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK
# fields are passed with -e to yppasswdd, see it's manpage.
# Possible values: "chsh", "chfn", "chsh,chfn"
YPCHANGEOK=chsh
# NIS master server. If this is configured on a slave server then ypinit
# will be run each time NIS is started.
NISMASTER=
# Additional options to be given to ypserv when it is started.
YPSERVARGS=
# Additional options to be given to ypbind when it is started.
YPBINDARGS=
# Additional options to be given to yppasswdd when it is started. Note
# that if -p is set then the YPPWDDIR above should be empty.
YPPASSWDDARGS=
# Additional options to be given to ypxfrd when it is started.
YPXFRDARGS=

39
nis/nis.server Executable file
View File

@ -0,0 +1,39 @@
#
# /etc/defaults/nis Optional configuration settings for the NIS programs.
#
#
# The following two variables are still used in the init script, but
# ignored by systemd. See `nis.debian.howto` in the documentation
# directory for more information.
#
# Are we a NIS server and if so what kind (values: false, slave, master)?
NISSERVER=master
# Are we a NIS client?
NISCLIENT=false
# Location of the master NIS password file (for yppasswdd).
# If you change this make sure it matches with /var/yp/Makefile.
YPPWDDIR=/etc
# Do we allow the user to use ypchsh and/or ypchfn ? The YPCHANGEOK
# fields are passed with -e to yppasswdd, see it's manpage.
# Possible values: "chsh", "chfn", "chsh,chfn"
YPCHANGEOK=chsh
# NIS master server. If this is configured on a slave server then ypinit
# will be run each time NIS is started.
NISMASTER=
# Additional options to be given to ypserv when it is started.
YPSERVARGS=
# Additional options to be given to ypbind when it is started.
YPBINDARGS=
# Additional options to be given to yppasswdd when it is started. Note
# that if -p is set then the YPPWDDIR above should be empty.
YPPASSWDDARGS=
# Additional options to be given to ypxfrd when it is started.
YPXFRDARGS=

20
nis/nsswitch.conf Executable file
View File

@ -0,0 +1,20 @@
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: files nis systemd
group: files nis systemd
shadow: files nis
hosts: files nis dns myhostname
gshadow: files
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis

14
nis/yp.conf Executable file
View File

@ -0,0 +1,14 @@
#
# yp.conf Configuration file for the ypbind process. You can define
# NIS servers manually here if they can't be found by
# broadcasting on the local net (which is the default).
#
# See the manual page of ypbind for the syntax of this file.
#
# IMPORTANT: For the "ypserver", use IP addresses, or make sure that
# the host is in /etc/hosts. This file is only interpreted
# once, and if DNS isn't reachable yet the ypserver cannot
# be resolved and ypbind won't ever bind to the server.
# ypserver ypserver.network.com
ypserver xnode

19
nis/ypserv.securenets Executable file
View File

@ -0,0 +1,19 @@
#
# securenets This file defines the access rights to your NIS server
# for NIS clients. This file contains netmask/network
# pairs. A clients IP address needs to match with at least
# one of those.
#
# One can use the word "host" instead of a netmask of
# 255.255.255.255. Only IP addresses are allowed in this
# file, not hostnames.
#
# Always allow access for localhost, IPv4 and IPv6
255.0.0.0 127.0.0.0
#host ::1
# This lines gives access to everybody. PLEASE ADJUST!
#0.0.0.0 0.0.0.0
255.255.255.0 10.0.2.0
255.255.255.0 10.0.1.0
#::/0

30
s1.host.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
echo "================old file:================"
cat /etc/hosts
echo "================hosts.txt================"
cat files/hosts.txt
echo ""
read -r -p "Do you want to append the host.txt? [y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "You say Yes"
echo "================do job ...================"
cat files/hosts.txt | sudo tee -a /etc/hosts
echo "================new file:"================
cat /etc/hosts
;;
[nN][oO]|[nN])
echo "You say No"
;;
*)
echo "skip"
exit 1
;;
esac

37
s2.install.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
echo "set time zone"
echo "sudo timedatectl set-timezone Asia/Shanghai"
sudo timedatectl set-timezone Asia/Shanghai
# +++++++++++++++++++++++++++++++++++++++
echo sudo apt update
sudo apt update
# +++++++++++++++++++++++++++++++++++++++
echo ""
echo sudo apt install munge slurm-wlm nfs-common nfs-server nis gdal-bin libgdal-dev mailutils -y
sudo apt install munge slurm-wlm slurmd nfs-common nfs-server nis gdal-bin libgdal-dev mailutils -y
# +++++++++++++++++++++++++++++++++++++++
echo sudo apt install iperf3 -y
sudo apt install iperf3 -y
# +++++++++++++++++++++++++++++++++++++++
echo ""
echo "Install gcc etc."
echo "sudo apt install gcc g++ gfortran openmpi-bin libomp-dev -y"
sudo apt install gcc g++ gfortran openmpi-bin cmake libomp-dev -y
# +++++++++++++++++++++++++++++++++++++++
echo ""
sudo apt install mpich -y
sudo apt-get install libopenmpi-dev -y
# NIS +++++++++++++++++++++++++++++++++++++++
echo sudo apt-get install rpcbind nis -y
sudo apt-get install rpcbind nis -y
echo "DONE"

29
s3.munge.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# for SERVER only
echo sudo rm -rf /etc/munge/munge.key
sudo rm -rf /etc/munge/munge.key
echo sudo create-munge-key -f -r
sudo create-munge-key -f -r
echo ""
echo "copy munge to home folder"
echo "sudo cp /etc/munge/munge.key ~/config/files/munge.key"
sudo cp /etc/munge/munge.key ~/config/files/munge.key
echo sudo chown laoban: ~/config/files/munge.key
sudo chown laoban: ~/config/files/munge.key
echo ""
echo "change owner"
echo "sudo chown munge:munge /etc/munge/munge.key"
sudo chown munge:munge /etc/munge/munge.key
echo ""
echo "start munge"
echo "sudo /etc/init.d/munge start"
sudo /etc/init.d/munge start
echo ""
echo "===check status==="
echo "systemctl status munge"
systemctl status munge

45
s4.config.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# for SERVER only
echo ""
echo "sudo cp files/slurm.conf /etc/slurm-lln/slurm.conf"
sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
echo ""
echo "sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf"
sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
echo ""
echo "make folders"
sudo mkdir /var/slurm
sudo mkdir /var/slurm/slurmctld
sudo mkdir /var/slurm/run
sudo chown -R slurm: /var/slurm
ls -g /var/slurm
echo ""
echo "sudo rm /var/slurm/slurmctld.log"
#sudo rm /var/slurm/slurmctld.log
echo ""
echo "=====start the severice ====="
echo "sudo systemctl enable slurmctld"
sudo systemctl enable slurmctld
echo "sudo service slurmctld start"
sudo service slurmctld start
sleep 1
echo ""
echo "check status"
echo "systemctl status slurmctld"
systemctl status slurmctld
echo ""
echo "sudo cat /var/slurm/slurmctld.log"
sudo cat /var/slurm/slurmctld.log
echo "DONE"

24
s5.check.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# for xnode only
echo for SERVER only
echo ls /var/slurm
ls /var/slurm
echo sudo tail /var/slurm/slurmctld.log
sudo tail /var/slurm/slurmctld.log
echo ""
echo "systemctl status slurmctld"
systemctl status slurmctld
echo ""
echo "sinfo"
sinfo
echo ""
echo ""
echo "---test---"
srun -N 2 hostname

18
screenMSG.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
sudo rm -rf /etc/update-motd.d/00-header
sudo rm -rf /etc/update-motd.d/10-help-text
sudo rm -rf /etc/update-motd.d/50-motd-news
sudo rm -rf /etc/update-motd.d/85-fwupd
sudo rm -rf /etc/update-motd.d/88-esm-announce
sudo rm -rf /etc/update-motd.d/90-updates-available
sudo rm -rf /etc/update-motd.d/91-contract-ua-esm-status
sudo rm -rf /etc/update-motd.d/91-release-upgrade
sudo rm -rf /etc/update-motd.d/92-unattended-upgrades
sudo rm -rf /etc/update-motd.d/95-hwe-eol
sudo rm -rf /etc/update-motd.d/97-overlayroot
sudo rm -rf /etc/update-motd.d/98-fsck-at-reboot
sudo rm -rf /etc/update-motd.d/98-reboot-required
echo "This is $HOSTNAME" > /etc/motd

12
slurmoff.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
echo sudo systemctl stop slurmctld
sudo systemctl stop slurmctld
echo sudo systemctl stop slurmd
sudo systemctl stop slurmd
echo sudo systemctl status slurmctld
sudo systemctl status slurmctld

6
slurmon.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
echo sudo systemctl start slurmctld
sudo systemctl start slurmctld
echo sudo systemctl status slurmctld
sudo systemctl status slurmctld

18
ss.install.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
sudo apt-get update
echo "set time zone"
echo "sudo timedatectl set-timezone Asia/Shanghai"
sudo timedatectl set-timezone Asia/Shanghai
echo ""
echo "sudo apt install munge slurm-wlm nis nfs-common -y"
sudo apt install munge slurm-wlm nis nfs-common -y
echo ""
echo "Install gcc etc."
echo "sudo apt install gcc g++ gfortran openmpi-bin libomp-dev -y"
sudo apt install gcc g++ gfortran openmpi-bin libomp-dev -y
echo "DONE"

10
ss.nfs.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
echo sudo cp ~/config/files/exports /etc/exports
sudo cp ~/config/files/exports /etc/exports
echo sudo exportfs -a
sudo exportfs
echo "done"

24
ss.slurm.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
echo apt-get install make hwloc libhwloc-dev libmunge-dev libmunge2 munge mariadb-server libmysqlclient-dev -y
sudo apt-get install make hwloc libhwloc-dev libmunge-dev libmunge2 munge mariadb-server libmysqlclient-dev -y
echo cd slurm-20.08.8
cd slurm-20.08.8
echo ./configure --prefix=/opt/slurm/ --sysconfdir=/opt/slurm/etc
./configure --prefix=/opt/slurm/ --sysconfdir=/opt/slurm/etc
echo make -j16
make -j16
echo make install
make install
sudo cp -r etc/slurm*.service /etc/systemd/system/
sudo systemctl enable mariadb
sudosystemctl start mariadb
sudo systemctl status mariadb

21
ss.upslurm.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
echo ""
echo sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
echo ""
echo "sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf"
sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
echo sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
echo sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
echo sudo systemctl restart slurmctld
sudo systemctl restart slurmctld
sleep 3
echo sudo systemctl status slurmctld
sudo systemctl status slurmctld

30
x0.host.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
echo "================old file:================"
cat /etc/hosts
echo "================hosts.txt================"
cat ~/config/files/hosts.txt
echo ""
read -r -p "Do you want to append the host.txt? [y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "You say Yes"
echo "================do job ...================"
cat ~/config/files/hosts.txt | sudo tee -a /etc/hosts
echo "================new file:"================
cat /etc/hosts
;;
[nN][oO]|[nN])
echo "You say No"
;;
*)
echo "skip"
exit 1
;;
esac

47
x1.slurmd.sh Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
echo "set time zone"
echo "sudo timedatectl set-timezone Asia/Shanghai"
sudo timedatectl set-timezone Asia/Shanghai
echo ""
echo "make folders"
sudo rm -rf /var/slurm
sudo mkdir /var/slurm
sudo touch /var/slurm/slurmd.log
sudo mkdir /var/slurm/slurmd
sudo mkdir /var/slurm/run
sudo mkdir /run/slurm
sudo mkdir /etc/slurm-llnl/
sudo chown -R slurm: /var/slurm
sudo chown -R slurm: /run/slurm
ls -g /var/slurm
echo ""
echo "sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf"
sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
echo ""
echo "sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf"
sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
echo ""
echo "=====start the severice ====="
echo sudo systemctl stop slurmd
sudo systemctl stop slurmd
echo sudo systemctl start slurmd
sudo systemctl start slurmd
echo ""
echo "check status"
echo "systemctl status slurmd"
systemctl status slurmd
echo ""
echo "sudo cat /var/slurm/slurmd.log"
sudo cat /var/slurm/slurmd.log
echo "DONE"

34
x2.munge.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/bash
echo "sudo mkdir /etc/munge/"
sudo mkdir /etc/munge/
echo ""
echo "copy munge"
echo sudo cp ~/config/files/munge.key /etc/munge/munge.key
sudo cp ~/config/files/munge.key /etc/munge/munge.key
echo ""
echo "change owner"
echo "sudo chown munge:munge /etc/munge/munge.key"
sudo chown munge:munge /etc/munge/munge.key
echo sudo chmod 600 /etc/munge/munge.key
sudo chmod 600 /etc/munge/munge.key
echo ""
echo "start munge"
echo "sudo /etc/init.d/munge start"
sudo /etc/init.d/munge start
sudo systemctl restart munge
sleep 2
echo ""
echo "===check status==="
echo "systemctl status munge"
sudo systemctl status munge
echo "munge -n | ssh laoban@xnode unmunge"
munge -n | ssh laoban@xnode unmunge
echo "DONE"

12
x3.check.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# for comput node only
echo for comput node only
echo ""
echo "systemctl status slurmd"
systemctl status slurmd
echo ls /var/slurm
ls /var/slurm
echo sudo tail /var/slurm/slurmd.log
sudo tail /var/slurm/slurmd.log

38
xx.install.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/bash
echo "set time zone"
echo "sudo timedatectl set-timezone Asia/Shanghai"
sudo timedatectl set-timezone Asia/Shanghai
# +++++++++++++++++++++++++++++++++++++++
echo sudo apt update
sudo apt update
sudo apt install debconf-utils -y
# +++++++++++++++++++++++++++++++++++++++
echo ""
echo sudo apt install munge nfs-common nis gdal-bin libgdal-dev mailutils -y
sudo apt install munge slurmd nfs-common nis gdal-bin libgdal-dev mailutils -y
# +++++++++++++++++++++++++++++++++++++++
echo sudo apt install iperf3 -y
sudo apt install iperf3 -y
# +++++++++++++++++++++++++++++++++++++++
echo ""
echo "Install gcc etc."
#echo "sudo apt install gcc g++ gfortran openmpi-bin libomp-dev -y"
#sudo apt install gcc g++ gfortran openmpi-bin cmake libomp-dev -y
# +++++++++++++++++++++++++++++++++++++++
echo ""
sudo apt install mpich -y
sudo apt-get install libopenmpi-dev libomp-dev -y
# NIS +++++++++++++++++++++++++++++++++++++++
echo sudo apt-get install rpcbind nis -y
sudo apt-get install rpcbind nis -y
echo "DONE"

57
xx.mount.sh Executable file
View File

@ -0,0 +1,57 @@
#!/bin/bas
:q
echo "sudo mkdir -p /data /users /scratch"
echo "sudo chmod -R 750 /users /scratch"
sudo mkdir -p /data /users /scratch
sudo chmod -R 750 /users /scratch
echo "================old /etc/fstab:================"
echo "sudo cat /etc/fstab"
sudo cat /etc/fstab
echo "================hosts.txt================"
echo "cat ~/config/files/fstab.txt"
cat ~/config/files/fstab.cn.txt
echo ""
read -r -p "Do you want to append the file? [y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "You say Yes"
echo "================do job ...================"
cat ~/config/files/fstab.cn.txt | sudo tee -a /etc/fstab
echo "================new file:"================
sudo cat /etc/fstab
;;
[nN][oO]|[nN])
echo "You say No"
;;
*)
echo "skip"
exit 1
;;
esac
echo " module "
echo " module "
echo " module "
echo cp ~/config/files/nodeenv.sh /etc/profile.d/
sudo cp ~/config/files/nodeenv.sh /etc/profile.d/
export PATH="$PATH:/opt/R/bin/"
export PATH="$PATH:/opt/bin/"
export PATH="$PATH:/opt/Modules/bin"
echo sudo cp /opt/Modules/init/profile.sh /etc/profile.d
sudo cp /opt/Modules/init/profile.sh /etc/profile.d
echo sudo mount -a
sudo mount -a
echo df -hT
df -hT

37
xx.slurm.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
echo sudo apt remove -y slurmd slurmctld slurmdbd slurm-client slurm-wlm-*
sudo apt remove -y slurmd slurmctld slurmdbd slurm-client slurm-wlm-*
echo sudo apt autoremove -y
sudo apt autoremove -y
echo sudo apt-get install make hwloc libhwloc-dev libmunge-dev libmunge2 munge -y
sudo apt-get install make hwloc libhwloc-dev libmunge-dev libmunge2 munge -y
sudo rm /etc/systemd/system/slurmd.service
sudo rm /etc/systemd/system/slurmdbd.service
sudo rm /etc/systemd/system/slurmctld.service
echo sudo cp -r ~/config/files/slurm*.service /etc/systemd/system/
sudo cp -r ~/config/files/slurm*.service /etc/systemd/system/
echo sudo chown root: /etc/systemd/system/slurm*.service
sudo chown root: /etc/systemd/system/slurm*.service
echo sudo chmod 600 /etc/systemd/system/slurm*.service
sudo chmod 600 /etc/systemd/system/slurm*.service
cat ~/config/files/bash.txt | sudo tee -a /etc/bash.bashrc
export PATH=$PATH:/opt/slurm//bin:/opt/slurm//sbin
sudo systemctl enable slurmd
sudo systemctl start slurmd
sudo systemctl status slurmd

22
xx.upslurm.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
echo ""
echo sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
echo ""
echo "sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf"
sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
echo sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
sudo cp ~/config/files/slurm.conf /etc/slurm-llnl/slurm.conf
echo sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
sudo chown slurm:slurm /etc/slurm-llnl/slurm.conf
echo sudo systemctl restart slurmd
sudo systemctl restart slurmd
sleep 3
echo sudo systemctl status slurmd
sudo systemctl status slurmd