Colo: Put NVMe disks to use (#6357)

automerge
This commit is contained in:
Trent Nelson
2019-10-17 15:44:45 -06:00
committed by Grimes
parent 9e52d11ad0
commit 1759968c1e
7 changed files with 42 additions and 42 deletions

View File

@ -15,8 +15,9 @@ netConfigDir="$netDir"/config
netLogDir="$netDir"/log
mkdir -p "$netConfigDir" "$netLogDir"
SOLANA_ROOT="$netDir"/..
# shellcheck source=scripts/configure-metrics.sh
source "$(dirname "${BASH_SOURCE[0]}")"/../scripts/configure-metrics.sh
source "$SOLANA_ROOT"/scripts/configure-metrics.sh
configFile="$netConfigDir/config"
geoipConfigFile="$netConfigDir/geoip.yml"
@ -94,3 +95,28 @@ urlencode() {
done
}
SOLANA_CONFIG_DIR=$SOLANA_ROOT/config
# Clear the current cluster configuration
clear_config_dir() {
declare config_dir="$1"
(
set -x
rm -rf "${config_dir:?}/" # <-- $i might be a symlink, rm the other side of it first
rm -rf "$config_dir"
mkdir -p "$config_dir"
)
setup_secondary_mount
}
SECONDARY_DISK_MOUNT_POINT=/mnt/extra-disk
setup_secondary_mount() {
# If there is a secondary disk, symlink the config/ dir there
if [[ -d $SECONDARY_DISK_MOUNT_POINT ]] && \
[[ -w $SECONDARY_DISK_MOUNT_POINT ]]; then
mkdir -p $SECONDARY_DISK_MOUNT_POINT/config
rm -rf "$SOLANA_CONFIG_DIR"
ln -sfT $SECONDARY_DISK_MOUNT_POINT/config "$SOLANA_CONFIG_DIR"
fi
}