commit 37ef0c6ab52681cfd5b7ea54d369ccf220cba64b Author: baol Date: Tue Dec 17 14:40:01 2024 +0800 first commit diff --git a/Rinstall.sh b/Rinstall.sh new file mode 100755 index 0000000..af98fdb --- /dev/null +++ b/Rinstall.sh @@ -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 + diff --git a/_bashrc b/_bashrc new file mode 100755 index 0000000..40b53fc --- /dev/null +++ b/_bashrc @@ -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 diff --git a/bak/s3.munge.sh b/bak/s3.munge.sh new file mode 100755 index 0000000..015420a --- /dev/null +++ b/bak/s3.munge.sh @@ -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 diff --git a/cp2node.sh b/cp2node.sh new file mode 100755 index 0000000..305cf1a --- /dev/null +++ b/cp2node.sh @@ -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:~/ diff --git a/cpfnode.sh b/cpfnode.sh new file mode 100755 index 0000000..5962b68 --- /dev/null +++ b/cpfnode.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo scp -r laoban@10.0.1.100:~/config ~/ +scp -r laoban@10.0.1.100:~/config ~/ + diff --git a/files/bak.hosts.txt b/files/bak.hosts.txt new file mode 100755 index 0000000..007e76a --- /dev/null +++ b/files/bak.hosts.txt @@ -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 + diff --git a/files/bash.txt b/files/bash.txt new file mode 100644 index 0000000..7725724 --- /dev/null +++ b/files/bash.txt @@ -0,0 +1,2 @@ +export PATH=$PATH:/opt/slurm/bin:/opt/slurm/sbin + diff --git a/files/defaultdomain b/files/defaultdomain new file mode 100755 index 0000000..4c2abae --- /dev/null +++ b/files/defaultdomain @@ -0,0 +1 @@ +hpc.shud diff --git a/files/exports b/files/exports new file mode 100755 index 0000000..289be7a --- /dev/null +++ b/files/exports @@ -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) + diff --git a/files/fstab.cn.txt b/files/fstab.cn.txt new file mode 100755 index 0000000..3dbeb04 --- /dev/null +++ b/files/fstab.cn.txt @@ -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 diff --git a/files/fstab.txt b/files/fstab.txt new file mode 100755 index 0000000..0959035 --- /dev/null +++ b/files/fstab.txt @@ -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 diff --git a/files/hosts.txt b/files/hosts.txt new file mode 100755 index 0000000..12bd7f1 --- /dev/null +++ b/files/hosts.txt @@ -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 diff --git a/files/munge.key b/files/munge.key new file mode 100755 index 0000000..406140c Binary files /dev/null and b/files/munge.key differ diff --git a/files/nis b/files/nis new file mode 100755 index 0000000..100f851 --- /dev/null +++ b/files/nis @@ -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= diff --git a/files/nis.client b/files/nis.client new file mode 100755 index 0000000..e1e9e02 --- /dev/null +++ b/files/nis.client @@ -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= diff --git a/files/nis.server b/files/nis.server new file mode 100755 index 0000000..100f851 --- /dev/null +++ b/files/nis.server @@ -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= diff --git a/files/nodeenv.sh b/files/nodeenv.sh new file mode 100755 index 0000000..5a9c596 --- /dev/null +++ b/files/nodeenv.sh @@ -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" + diff --git a/files/on.yaml b/files/on.yaml new file mode 100755 index 0000000..cc31d11 --- /dev/null +++ b/files/on.yaml @@ -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 diff --git a/files/slurm.conf b/files/slurm.conf new file mode 100755 index 0000000..f21cf75 --- /dev/null +++ b/files/slurm.conf @@ -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 diff --git a/files/slurmctld.service b/files/slurmctld.service new file mode 100644 index 0000000..a55f1c1 --- /dev/null +++ b/files/slurmctld.service @@ -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 diff --git a/files/slurmd.service b/files/slurmd.service new file mode 100644 index 0000000..37a2c90 --- /dev/null +++ b/files/slurmd.service @@ -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 diff --git a/files/slurmdbd.service b/files/slurmdbd.service new file mode 100644 index 0000000..dc49957 --- /dev/null +++ b/files/slurmdbd.service @@ -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 diff --git a/files/slurmrestd.service b/files/slurmrestd.service new file mode 100644 index 0000000..cd86165 --- /dev/null +++ b/files/slurmrestd.service @@ -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 diff --git a/files/xnode.yaml b/files/xnode.yaml new file mode 100755 index 0000000..3c015a5 --- /dev/null +++ b/files/xnode.yaml @@ -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 diff --git a/files/yp.conf b/files/yp.conf new file mode 100755 index 0000000..284440e --- /dev/null +++ b/files/yp.conf @@ -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 diff --git a/files/ypserv.securenets b/files/ypserv.securenets new file mode 100755 index 0000000..889661f --- /dev/null +++ b/files/ypserv.securenets @@ -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 diff --git a/ib.sh b/ib.sh new file mode 100755 index 0000000..29fc406 --- /dev/null +++ b/ib.sh @@ -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 + diff --git a/netoff.sh b/netoff.sh new file mode 100755 index 0000000..92df27a --- /dev/null +++ b/netoff.sh @@ -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 diff --git a/neton.sh b/neton.sh new file mode 100755 index 0000000..98d2c57 --- /dev/null +++ b/neton.sh @@ -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 diff --git a/nis.client.sh b/nis.client.sh new file mode 100755 index 0000000..f601666 --- /dev/null +++ b/nis.client.sh @@ -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 + + diff --git a/nis.server.sh b/nis.server.sh new file mode 100755 index 0000000..ee233ba --- /dev/null +++ b/nis.server.sh @@ -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 + diff --git a/nis/defaultdomain b/nis/defaultdomain new file mode 100755 index 0000000..4c2abae --- /dev/null +++ b/nis/defaultdomain @@ -0,0 +1 @@ +hpc.shud diff --git a/nis/nis b/nis/nis new file mode 100755 index 0000000..100f851 --- /dev/null +++ b/nis/nis @@ -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= diff --git a/nis/nis.client b/nis/nis.client new file mode 100755 index 0000000..e1e9e02 --- /dev/null +++ b/nis/nis.client @@ -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= diff --git a/nis/nis.server b/nis/nis.server new file mode 100755 index 0000000..100f851 --- /dev/null +++ b/nis/nis.server @@ -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= diff --git a/nis/nsswitch.conf b/nis/nsswitch.conf new file mode 100755 index 0000000..f18bd40 --- /dev/null +++ b/nis/nsswitch.conf @@ -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 diff --git a/nis/yp.conf b/nis/yp.conf new file mode 100755 index 0000000..284440e --- /dev/null +++ b/nis/yp.conf @@ -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 diff --git a/nis/ypserv.securenets b/nis/ypserv.securenets new file mode 100755 index 0000000..f8687ff --- /dev/null +++ b/nis/ypserv.securenets @@ -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 diff --git a/s1.host.sh b/s1.host.sh new file mode 100755 index 0000000..2c2ca08 --- /dev/null +++ b/s1.host.sh @@ -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 + + + + diff --git a/s2.install.sh b/s2.install.sh new file mode 100755 index 0000000..a0a5f59 --- /dev/null +++ b/s2.install.sh @@ -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" + diff --git a/s3.munge.sh b/s3.munge.sh new file mode 100755 index 0000000..26055fd --- /dev/null +++ b/s3.munge.sh @@ -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 diff --git a/s4.config.sh b/s4.config.sh new file mode 100755 index 0000000..98d5de7 --- /dev/null +++ b/s4.config.sh @@ -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" + diff --git a/s5.check.sh b/s5.check.sh new file mode 100755 index 0000000..5c5a985 --- /dev/null +++ b/s5.check.sh @@ -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 + diff --git a/screenMSG.sh b/screenMSG.sh new file mode 100755 index 0000000..c36b0ca --- /dev/null +++ b/screenMSG.sh @@ -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 diff --git a/slurmoff.sh b/slurmoff.sh new file mode 100755 index 0000000..1a6722a --- /dev/null +++ b/slurmoff.sh @@ -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 + + diff --git a/slurmon.sh b/slurmon.sh new file mode 100755 index 0000000..36705ec --- /dev/null +++ b/slurmon.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo sudo systemctl start slurmctld +sudo systemctl start slurmctld +echo sudo systemctl status slurmctld +sudo systemctl status slurmctld diff --git a/ss.install.sh b/ss.install.sh new file mode 100755 index 0000000..617f917 --- /dev/null +++ b/ss.install.sh @@ -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" + diff --git a/ss.nfs.sh b/ss.nfs.sh new file mode 100755 index 0000000..306dab1 --- /dev/null +++ b/ss.nfs.sh @@ -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" + + diff --git a/ss.slurm.sh b/ss.slurm.sh new file mode 100755 index 0000000..ee8839b --- /dev/null +++ b/ss.slurm.sh @@ -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 + + diff --git a/ss.upslurm.sh b/ss.upslurm.sh new file mode 100755 index 0000000..5cee610 --- /dev/null +++ b/ss.upslurm.sh @@ -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 diff --git a/x0.host.sh b/x0.host.sh new file mode 100755 index 0000000..7060a00 --- /dev/null +++ b/x0.host.sh @@ -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 + + + + diff --git a/x1.slurmd.sh b/x1.slurmd.sh new file mode 100755 index 0000000..827c3d4 --- /dev/null +++ b/x1.slurmd.sh @@ -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" + diff --git a/x2.munge.sh b/x2.munge.sh new file mode 100755 index 0000000..fe139a6 --- /dev/null +++ b/x2.munge.sh @@ -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" diff --git a/x3.check.sh b/x3.check.sh new file mode 100755 index 0000000..12e0524 --- /dev/null +++ b/x3.check.sh @@ -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 diff --git a/xx.install.sh b/xx.install.sh new file mode 100755 index 0000000..0232ad7 --- /dev/null +++ b/xx.install.sh @@ -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" + diff --git a/xx.mount.sh b/xx.mount.sh new file mode 100755 index 0000000..91f671e --- /dev/null +++ b/xx.mount.sh @@ -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 + + + diff --git a/xx.slurm.sh b/xx.slurm.sh new file mode 100755 index 0000000..7037b20 --- /dev/null +++ b/xx.slurm.sh @@ -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 + + + diff --git a/xx.upslurm.sh b/xx.upslurm.sh new file mode 100755 index 0000000..df01abd --- /dev/null +++ b/xx.upslurm.sh @@ -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