azurehpc/scripts/lsfinstall.sh

79 строки
2.8 KiB
Bash
Исходник Обычный вид История

2019-09-03 11:34:41 +03:00
#!/bin/bash
LSF_DOWNLOAD_DIR=/mnt/resource
LSF_INSTALL_DIR=$LSF_DOWNLOAD_DIR/lsf10.1_lsfinstall
LSF_INSTALL_CONFIG=$LSF_INSTALL_DIR/lsf.install.config
2019-09-04 15:02:01 +03:00
LSF_TOP=/apps/lsf
2019-09-04 21:06:34 +03:00
LSF_CONF=$LSF_TOP/conf/lsf.conf
2019-09-05 15:48:14 +03:00
CLUSTERNAME=azhpc
LSFADMIN=hpcadmin
2019-09-04 19:10:23 +03:00
# Install dependencies
yum -y install jre
2019-09-03 11:34:41 +03:00
# Fill up install configuration file
cp $LSF_INSTALL_DIR/install.config $LSF_INSTALL_CONFIG
2019-09-04 15:02:01 +03:00
echo "Updating install.config"
sed -i 's|# LSF_TOP="/usr/share/lsf"|LSF_TOP="'$LSF_TOP'"|g' $LSF_INSTALL_CONFIG
2019-09-05 15:48:14 +03:00
sed -i 's|# LSF_ADMINS="lsfadmin user1 user2"|LSF_ADMINS="'$LSFADMIN'"|g' $LSF_INSTALL_CONFIG
sed -i 's|# LSF_CLUSTER_NAME="cluster1"|LSF_CLUSTER_NAME="'$CLUSTERNAME'"|g' $LSF_INSTALL_CONFIG
2019-09-04 15:02:01 +03:00
sed -i 's|# LSF_MASTER_LIST="hostm hosta hostc"|LSF_MASTER_LIST="'$(hostname)'"|g' $LSF_INSTALL_CONFIG
sed -i 's|# LSF_ENTITLEMENT_FILE="/usr/share/lsf/lsf_distrib/lsf_std_entitlement.dat"|LSF_ENTITLEMENT_FILE="'$LSF_DOWNLOAD_DIR'/lsf_std_entitlement.dat"|g' $LSF_INSTALL_CONFIG
sed -i 's|# LSF_TARDIR="/usr/share/lsf_distrib/"|LSF_TARDIR="'$LSF_DOWNLOAD_DIR'"|g' $LSF_INSTALL_CONFIG
2019-09-04 20:31:17 +03:00
sed -i 's/# CONFIGURATION_TEMPLATE="DEFAULT|PARALLEL|HIGH_THROUGHPUT"/CONFIGURATION_TEMPLATE="PARALLEL"/g' $LSF_INSTALL_CONFIG
2019-09-04 15:02:01 +03:00
sed -i 's|# SILENT_INSTALL="Y"|SILENT_INSTALL="Y"|g' $LSF_INSTALL_CONFIG
sed -i 's|# LSF_SILENT_INSTALL_TARLIST=""|LSF_SILENT_INSTALL_TARLIST="All"|g' $LSF_INSTALL_CONFIG
sed -i 's|# ACCEPT_LICENSE="N"|ACCEPT_LICENSE="Y"|g' $LSF_INSTALL_CONFIG
2019-09-04 20:03:23 +03:00
#sed -i 's|# ENABLE_EGO="N"|ENABLE_EGO="Y"|g' $LSF_INSTALL_CONFIG
#sed -i 's|# EGO_DAEMON_CONTROL="N"|EGO_DAEMON_CONTROL="Y"|g' $LSF_INSTALL_CONFIG
2019-09-04 15:02:01 +03:00
sed -i 's|# ENABLE_DYNAMIC_HOSTS="N"|ENABLE_DYNAMIC_HOSTS="Y"|g' $LSF_INSTALL_CONFIG
sed -i 's|# LSF_DYNAMIC_HOST_WAIT_TIME="60"|LSF_DYNAMIC_HOST_WAIT_TIME="60"|g' $LSF_INSTALL_CONFIG
echo "Installing"
pushd $LSF_INSTALL_DIR
./lsfinstall -f $LSF_INSTALL_CONFIG
cat Install.err
cat Install.log
echo "Apply patch"
pushd $LSF_TOP/10.1
tar zxvf $LSF_DOWNLOAD_DIR/lsf10.1_linux2.6-glibc2.3-x86_64-509238.tar.Z
cat << EOF >> /etc/lsf.sudoers
2019-09-05 15:48:14 +03:00
LSF_STARTUP_USERS="$LSFADMIN"
2019-09-04 15:02:01 +03:00
LSF_STARTUP_PATH="$LSF_TOP/10.1/linux2.6-glibc2.3-x86_64/etc"
EOF
chmod 0600 /etc/lsf.sudoers
cat << EOF >> /etc/profile.d/lsf.sh
source $LSF_TOP/conf/profile.lsf
EOF
chmod 0644 /etc/profile.d/lsf.sh
chown -R root:root $LSF_TOP
chmod 4755 $LSF_TOP/10.1/linux2.6-glibc2.3-x86_64/bin/lsadmin
chmod 4755 $LSF_TOP/10.1/linux2.6-glibc2.3-x86_64/bin/badmin
2019-09-05 15:48:14 +03:00
chown -R $LSFADMIN:$LSFADMIN $LSF_TOP/work/$CLUSTERNAME/
2019-09-04 19:10:23 +03:00
cat << EOF >> /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
EOF
# Update lsf.conf
2019-09-04 20:03:23 +03:00
#sed -i 's|LSF_ENABLE_EGO=Y|LSF_ENABLE_EGO=N|g' $LSF_CONF
2019-09-04 19:10:23 +03:00
master_domain=$(hostname -d)
cat << EOF >> $LSF_CONF
LSF_RSH="ssh -o 'PasswordAuthentication no' -o 'StrictHostKeyChecking no'"
LSF_STRIP_DOMAIN=.$master_domain
LSF_DYNAMIC_HOST_TIMEOUT=10m
EOF