Ubuntu安装HPC
cat>/etc/hosts<<EOF 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 168.7.10.80 ldap01.huawei.com 168.7.10.61 master01 168.7.10.62 master02 168.7.10.63 master03 168.7.10.64 master04 168.7.10.65 agent01 168.7.10.66 agent02 168.7.10.67 agent03 EOF hostname > /etc/hostname cat>/etc/hosts<<EOF 127.0.0.1 localhost 168.17.0.4 master01 168.17.0.3 master02 168.17.0.5 agent EOF #------------------------------------------------ # install base software apt install -y expect #------------------------------------------------ #config NTP Server apt install -y ntp apt install -y ntpdate systemctl enable ntp systemctl disable chrony && systemctl stop chrony cat >/etc/ntp.conf<<EOF driftfile /var/lib/ntp/ntp.drift leapfile /usr/share/zoneinfo/leap-seconds.list statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable pool ntp.ubuntu.com restrict -4 default kod notrap nomodify nopeer noquery limited restrict -6 default kod notrap nomodify nopeer noquery limited restrict 127.0.0.1 restrict ::1 restrict source notrap nomodify noquery ############################# # add User config ############################# server 127.127.1.0 iburst restrict default kod nomodify notrap nopeer noquery server 0.uk.pool.ntp.org iburst server 1.uk.pool.ntp.org iburst server 2.uk.pool.ntp.org iburst server 3.uk.pool.ntp.org iburst server 127.127.1.0 #local clock fudge 127.127.1.0 stratum 10 EOF systemctl enable ntp systemctl restart ntp systemctl status ntp ##################################################### apt install -y ntp echo server 168.17.0.2 >> /etc/ntp.conf /etc/init.d/ntp restart apt install -y ntp apt install -y ntpdate && ntpdate -u 168.17.0.2 #------------------------------------------------ #resource limits cat>>/etc/security/limits.conf<<EOF * soft memlock unlimited * hard memlock unlimited * soft stack unlimited * hard stack unlimited * soft nofile 1000000 * hard nofile 1000000 * hard nproc 1000000 * soft nproc 1000000 EOF cat>/etc/locale.conf<<EOF LANG="en_US.UTF-8" EOF systemctl enable NetworkManager reboot cat >/etc/hosts<<EOF 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 168.7.10.80 ldap01.huawei.com 168.7.10.61 master01 168.7.10.62 master02 168.7.10.63 master03 168.7.10.64 master04 168.7.10.65 agent01 168.7.10.66 agent02 168.7.10.67 agent03 EOF cat /etc/hosts #------------------------------------------------ # config NFS Server apt install -y nfs-common apt install -y nfs-kernel-server apt install -y rpcbind mkdir -p /data cat>/etc/exports<<EOF /share *(rw,no_root_squash,sync) EOF systemctl enable rpcbind systemctl start rpcbind /etc/init.d/nfs-kernel-server restart systemctl enable nfs-kernel-server #------------------------------------------------ #客户端添加文件到/etc/fstab apt install -y nfs-common mkdir -p /workspace mount.nfs 168.17.0.2:/data /workspace echo "168.17.0.2:/data /workspace nfs defaults,_netdev 0 0">>/etc/fstab #-------------------------------------------------------- # DonauScheduler User and group groupadd -g 60001 donau_guest useradd -g 60001 -m -u 60001 -s /bin/bash donau_guest echo "donau_guest:huawei@123" | chpasswd groupadd -g 60002 ccs_master useradd -g 60002 -m -u 60002 -s /bin/bash ccs_master echo "ccs_master:huawei@123" | chpasswd groupadd -g 60003 ccs_agent useradd -g 60003 -m -u 60003 -s /bin/bash ccs_agent echo "ccs_agent:huawei@123" | chpasswd groupadd -g 60004 ccs_auth useradd -g 60004 -m -u 60004 -s /bin/bash ccs_auth echo "ccs_auth:huawei@123" | chpasswd groupadd -g 60005 ccs_ignite useradd -g 60005 -m -u 60005 -s /bin/bash ccs_ignite echo "ccs_ignite:huawei@123" | chpasswd groupadd -g 60006 ccs_cli useradd -g 60006 -m -u 60006 -s /bin/bash ccs_cli echo "ccs_cli:huawei@123" | chpasswd groupadd -g 60007 postgres useradd -g 60007 -m -u 60007 -s /bin/bash postgres echo "postgres:huawei@123" | chpasswd groupadd -g 60008 ccs_etcd useradd -g 60008 -m -u 60008 -s /bin/bash ccs_etcd echo "ccs_etcd:huawei@123" | chpasswd #-------------------------------------------------------- # DonauPortal User and group groupadd -g 60009 ccp_sysadmin useradd -g 60009 -m -u 60009 -s /bin/bash ccp_sysadmin echo "ccp_sysadmin:huawei@123" | chpasswd groupadd -g 60010 ccp_audadmin useradd -g 60010 -m -u 60010 -s /bin/bash ccp_audadmin echo "ccp_audadmin:huawei@123" | chpasswd groupadd -g 60013 ccp_secadmin useradd -g 60013 -m -u 60013 -s /bin/bash ccp_secadmin echo "ccp_secadmin:huawei@123" | chpasswd useradd -g 60002 -m -u 60011 -s /bin/bash ccp_master echo "ccp_master:huawei@123" | chpasswd #-------------------------------------------------------- #create directory and authorization share_dir=workspace mkdir -p /${share_dir}/donau chown root:root /${share_dir}/donau chmod 755 /${share_dir}/donau -R mkdir -p /${share_dir}/license chown ccs_master:ccs_master /${share_dir}/license chmod 770 /${share_dir}/license -R mkdir -p /${share_dir}/data chown ccs_master:ccs_master /${share_dir}/data chmod 750 /${share_dir}/data -R mkdir -p /${share_dir}/dataupload chown ccp_master:root /${share_dir}/dataupload chmod 700 /${share_dir}/dataupload -R mkdir -p /${share_dir}/jobdata chown root:root /${share_dir}/jobdata chmod 755 /${share_dir}/jobdata -R mkdir -p /${share_dir}/portal_data chown root:root /${share_dir}/portal_data chmod 755 /${share_dir}/portal_data -R mkdir -p /${share_dir}/scheduler_db chown root:root /${share_dir}/scheduler_db chmod 755 /${share_dir}/scheduler_db -R mkdir -p /${share_dir}/portal_db chown root:root /${share_dir}/portal_db chmod 755 /${share_dir}/portal_db -R mkdir -p /${share_dir}/backup chown root:root /${share_dir}/backup chmod 755 /${share_dir}/backup -R mkdir -p /${share_dir}/scheduler_agent chown root:root /${share_dir}/scheduler_agent chmod 755 /${share_dir}/scheduler_agent -R mkdir -p /${share_dir}/storage chown ccp_master:root /${share_dir}/storage chmod 755 /${share_dir}/storage -R mkdir -p /${share_dir}/mpi chown root:root /${share_dir}/mpi chmod 755 /${share_dir}/mpi -R mkdir -p /opt/donau/1.2.1/ chmod 755 /opt/donau/1.2.1 #------------------------------------------------------------ --- # 单网卡配置IP地址 network: version: 2 renderer: networkd ethernets: enp131s0: addresses: [ 168.17.0.5/24 ] gateway4: 168.17.0.1 nameservers: addresses: - "114.114.114.114" --- --- #两张网卡配置bond4 network: ethernets: enp1s0f0: addresses: [] dhcp4: true dhcp6: true enp1s0f1: addresses: [] dhcp4: true dhcp6: true bonds: bond0: addresses: [ 168.17.0.6/24 ] gateway4: 168.17.0.1 nameservers: addresses: [ 8.8.8.8,114.114.114.114 ] interfaces: - enp1s0f0 - enp1s0f1 parameters: lacp-rate: fast mode: 802.3ad transmit-hash-policy: layer2 --- --- #多网卡配置多个子接口 network: version: 2 ethernets: enp132s0: dhcp4: no enp133s0: dhcp4: no vlans: enp132s0.vlan22: id: 33 link: enp133s0 addresses: [ "172.31.33.103/24" ] enp132s0.vlan44: id: 44 link: enp133s0 addresses: [ "172.31.44.103/24" ] enp133s0.vlan10: id: 10 link: enp133s0 addresses: [ "172.31.10.103/24" ] enp133s0.vlan11: id: 11 link: enp133s0 addresses: [ "172.31.11.103/24" ] --- netplan apply @@@@@@@@@@@@@@@@@@@@@@ 附录 @@@@@@@@@@@@@@@@@@@@@@ deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse echo "168.7.10.235:/share /workspace nfs defaults,_netdev 0 0" >> /etc/fstab cat>/etc/apt/sources.list<<OEF deb https://repo.huaweicloud.com/ubuntu-ports/ focal-security main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu-ports/ focal-security main restricted universe multiverse deb https://repo.huaweicloud.com/ubuntu-ports/ focal-updates main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu-ports/ focal-updates main restricted universe multiverse deb https://repo.huaweicloud.com/ubuntu-ports/ focal-backports main restricted universe multiverse deb-src https://repo.huaweicloud.com/ubuntu-ports/ focal-backports main restricted universe multiverse OEF