-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathremove_node_from_cluster
25 lines (20 loc) · 1.53 KB
/
remove_node_from_cluster
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#title :delete_node_from_cluster (wrapper script)
#description :This script will remove the given node from the cluster
#author :Maximilian Hanussek
#date :2018-01-31
#version :1.0
#usage :sh delete_node_from_cluster NODE_NAME_REMOVED SSH_KEY_PATH
#notes :Needs two parameter: hostname of the node and path to the ssh key of the node to be removed
#bash_version :4.2.46(1)-release
#=============================================================================================================================================================================================================
NODE_NAME_REMOVED=$1 #Get hostname of the node which has to be removed
SSH_KEY_PATH=$2 #Get path to the SSH key of the removing VM
echo "Removing node from torque"
delete_node_from_torque $NODE_NAME_REMOVED #Run script to remove the node from torque #Run script to remove the node from TORQUE batch system
echo "Removing node from beegfs filesystem (BeeOND)"
/opt/beegfs/sbin/beeond-remove-storage-node $NODE_NAME_REMOVED $SSH_KEY_PATH #Run script to remove the node from the beegfs filesystem
echo "Updating hosts files"
delete_from_host_file $NODE_NAME_REMOVED $SSH_KEY_PATH #Run script to update the /etc/hosts files of all nodes and clear it for the deleted node
echo "Updating UNICORE resources"
update_unicore_resources $SSH_KEY_PATH #Run script to update the available resources and make UNICORE aware of that