From fe5b141763de5c7b4a5636a4b210886bc928053e Mon Sep 17 00:00:00 2001 From: Luca Lombardo Date: Tue, 27 Jun 2023 10:57:47 +0200 Subject: [PATCH] aggiunto spazio raid allo script di motd --- Setup-iniziale.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Setup-iniziale.md b/Setup-iniziale.md index 776e808..4df9075 100644 --- a/Setup-iniziale.md +++ b/Setup-iniziale.md @@ -2,22 +2,22 @@ In più casi dovremo eseguire uno script su tutte i nodi, per farlo possiamo utilizzare il seguente script `runsetup.sh`: -```bash +```bash #!/bin/bash # Our custom function file=$1 -cust_func(){ +cust_func(){ echo "I am ${url}" scp $file root@$url:/root/$file ssh root@$url chmod +x /root/$file NUMBER=$(echo $url | tr -dc '0-9') ssh root@$url /root/$file $NUMBER -} +} while IFS= read -r url do cust_func "$url $file" & done < list.txt - + wait echo "All commands have been run." ``` @@ -74,6 +74,7 @@ HOSTNAME=$(uname -n) ROOT=$(df -Ph | grep mmcblk0p5 | awk '{print $4}' | tr -d '\n') IFS=. read -r s _ < /proc/uptime; d=$((s / 60 / 60 / 24)); h=$((s / 60 / 60 % 24)); m=$((s / 60 % 60)); [ "$d" = 0 ] || UPTIME="${UPTIME}${d}d "; [ "$h" = 0 ] || UPTIME="${UPTIME}${h}h "; [ "$m" = 0 ] || UPTIME="${UPTIME}${m}m "; UPTIME="${UPTIME:-0m}" KERNEL=$(uname -r) +RAID=$(lsblk -b -n -d | awk '$NF!~/sd[a-z]$/ && $NF!~/md[0-9]+$/ && !/loop/ {sum+=$4} END {printf "%.0f", sum/2/1024/1024/1024}') TEMP_BIG="$(paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C'/ | head -1| cut -d' ' -f3 )" @@ -93,12 +94,13 @@ echo "$(tput setaf 1)=================================================== | (_____ | | | (__ | (__ | (__ | (__ (_____ ) | | | __) | __) | __) | __) ) | | | | ( | ( | ( | ( -/\____) | | | | (____/\ ) | ) | (____/\ +/\____) | | | | (____/\ ) | ) | (____/ \_______) )_( (_______// |/ (_______/ $(tput setaf 2) =================================================== - Hostname............: $HOSTNAME - Disk Space..........: $ROOT remaining + - RAID Space..........: $RAID GB remaining $(tput setaf 4)=================================================== - CPU usage...........: $LOAD1, $LOAD5, $LOAD15 (1, 5, 15 min) - Memory used.........: $MEMORY1 / $MEMORY2 @@ -110,6 +112,7 @@ $(tput setaf 3)=================================================== - Uptime..............: $UPTIME $(tput sgr0)===================================================" ``` + ## `dnsmasq` e rete interna `dnsmasq` è un *software libero* che fornisce funzionalità di memorizzazione nella cache DNS (Domain Name System), un server DHCP (Dynamic Host Configuration Protocol), router advertisement e funzionalità di avvio di rete, destinato a reti di computer di piccole dimensioni. Nel nostro caso è utilizzato come server DHCP per assegnare gli indirizzi ai nodi del cluster sulla rete interna (NAT) e offrire un servizio di DNS (nodi raggiungibili tramite il loro nome e non tramite il loro indirizzo IP). @@ -318,7 +321,7 @@ help ### Assicurarsi che tutto funzioni al riavvio del Cluster 1. Montare RAID sul control node _se_ non l'ha fatto in automatico (ovvero spegnere e riaccendere il case dei dischi dal power button, fa tutto `/etc/fstab`) 2. Riavviare glusterd sui compute nodes (sicuramente non si sono avviati tutti prima del control node): [da `rock`]: `./runsetup.sh mountgluster.sh`. -3. Rimettere su i nodi (in modo che vadano tutti da DOWN ad IDLE nell'output di `sinfo`): +3. Rimettere su i nodi (in modo che vadano tutti da DOWN ad IDLE nell'output di `sinfo`): ``` for i in {1..20}; do sudo scontrol update nodename=steffe$i state=idle; done -``` \ No newline at end of file +```