#!/bin/bash exec 1>>/var/log/beegfs-setup.log exec 2>&1 # source config file CONFIG_FILE=/etc/beegfs/knu-setup.conf if [ -f "$CONFIG_FILE" ]; then source "$CONFIG_FILE" else echo "FATAL: Configuration file $CONFIG_FILE is missing" fi # get hostname nodename=$( hostname ) s_node () { [ "${nodename:0:1}" = "s" ] } # setup meta beegfs-setup-meta -f -m $BEEGFS_MGMT_HOST -p $BEEGFS_META_PATH # setup client beegfs-setup-client -m $BEEGFS_MGMT_HOST echo "${BEEGFS_MOUNT_POINT} /etc/beegfs/beegfs-client.conf" > /etc/beegfs/beegfs-mounts.conf # setup storage s_node && fhgfs-setup-storage -f -r -m $BEEGFS_MGMT_HOST -p $BEEGFS_STORAGE_PATH # cleanup previous installation systemctl start beegfs-helperd beegfs-ctl --removenode --nodetype=metadata $( beegfs-ctl --listnodes --nodetype=metadata | grep $nodename | awk '{print $3}' | sed 's/]//' ) #beegfs-ctl --removenode --nodetype=client $( beegfs-ctl --listnodes --nodetype=client | grep $nodename | awk '{print $3}' | sed 's/]//' ) if s_node; then storage_node=$( beegfs-ctl --listnodes --nodetype=storage | grep $nodename | awk '{print $3}' | sed 's/]//' ) if [ -n "$storage_node" ]; then for tgt in $( beegfs-ctl --listtargets | grep $storage_node | awk '{print $1}' ); do beegfs-ctl --unmaptarget $tgt done beegfs-ctl --removenode --nodetype=storage $storage_node fi fi # tune connRDMABufSize to MTU sed "/^connRDMABufSize/s/.*/connRDMABufSize = ${BEEGFS_CLIENT_MTU}/" -i /etc/beegfs/beegfs-client.conf # tune sysMountSanityCheckMS sed "/^sysMountSanityCheckMS/s/.*/sysMountSanityCheckMS = 0/" -i /etc/beegfs/beegfs-client.conf # tune client performance sed "/^connMaxInternodeNum/s/.*/connMaxInternodeNum = 64/" -i /etc/beegfs/beegfs-client.conf sed "/^tuneRemoteFSync/s/.*/tuneRemoteFSync = false/" -i /etc/beegfs/beegfs-client.conf