File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -exo pipefail
4+
5+
6+ storage_private_ips=$( terraform output -raw storage_private_ips)
7+ BASTION_IP=$( terraform output -raw bastion_public_ip)
8+ KEY=" ${KEY:- $HOME / .ssh/ id_ed25519} "
9+
10+ for node in $storage_private_ips ; do
11+ ssh -i " $KEY " -o StrictHostKeyChecking=no \
12+ -o ProxyCommand=" ssh -o StrictHostKeyChecking=no -i \" $KEY \" -W %h:%p ec2-user@$BASTION_IP " rocky@$node " sudo reboot"
13+ done
14+
15+ for node in $storage_private_ips ; do
16+ echo " Waiting for $node to come back online..."
17+ while ! ssh -i " $KEY " -o StrictHostKeyChecking=no \
18+ -o ProxyCommand=" ssh -o StrictHostKeyChecking=no -i \" $KEY \" -W %h:%p ec2-user@$BASTION_IP " rocky@$node " true" ; do
19+ sleep 5
20+ done
21+ done
22+
23+ for node in $storage_private_ips ; do
24+ ssh -i " $KEY " -o StrictHostKeyChecking=no \
25+ -o ProxyCommand=" ssh -o StrictHostKeyChecking=no -i \" $KEY \" -W %h:%p ec2-user@$BASTION_IP " rocky@$node "
26+ total_memory_kb=\$ (grep MemTotal /proc/meminfo | awk '{print \$ 2}')
27+ total_memory_mb=\$ ((total_memory_kb / 1024))
28+ hugepages=\$ ((total_memory_mb / 4 / 2))
29+ sudo sysctl -w vm.nr_hugepages=\$ hugepages
30+ sudo systemctl restart k3s-agent
31+ "
32+ done
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ echo "cluster ID: $CLUSTER_ID"
2828echo " cluster secret: $CLUSTER_SECRET "
2929
3030NETWORK_INTERFACE=" ens5"
31- if [ " $storage_node_distro " = " rhel9" -o " $storage_node_distro " = " rhel10 " ]; then
31+ if [ " $storage_node_distro " = " rhel9" -o " $storage_node_distro " = " rocky10 " ]; then
3232 NETWORK_INTERFACE=" eth0"
3333fi
3434
You can’t perform that action at this time.
0 commit comments