#!/bin/bash # Configure a simple NAS cluster as generated by autocluster.. set -e domain_auth="administrator" auth_type="files" conf_file="/root/scripts/nas.conf" . /root/scripts/functions #################### # show program usage usage () { cat >&2 < /dev/null || { echo "GPFS must be running to setup Samba" exit 1 } echo "Enabling ctdb..." onnode -p all chkconfig ctdb on case "$auth_type" in winbind) echo "Setting up NSS, PAM, KRB5..." onnode -p all authconfig --update --nostart \ --enablewinbindauth --enablewinbind \ --disablekrb5 --krb5kdc=$kdc.$domain --krb5realm=$domain ;; files) echo "Setting up NSS, PAM, KRB5..." onnode -p all authconfig --update --nostart \ --disablewinbindauth --disablewinbind \ --disablekrb5 --krb5kdc=$kdc.$domain --krb5realm=$domain ;; esac echo "Configuring services..." onnode -p all "(cd scripts/cluster_configure && \ ./cluster-configure.py -t 'templates/rhel/' -vv '$conf_file')" case "$auth_type" in winbind) echo "Joining domain" net ads join -U"$domain_auth" ;; esac echo "Restarting ctdb" onnode -p all "service ctdb restart" # let's hit this with a big hammer... for i in $(seq 1 5) ; do echo "Waiting until healthy" wait_until_healthy 60 && break echo "Nope, restart ctdb..." onnode -p all "service ctdb restart" done echo "Waiting for cluster to become healthy" wait_until_healthy echo "Setup done"