====== Cluster.conf ======
====== start_cluster.sh ======
#!/bin/bash
report_err(){
echo "$1"
}
echo "Starting cluster services..."
echo "Starting cman"
#cman_tool -wt10 join || report_err 'unable to join cluster'
service cman start || report_err 'unable to join cluster'
sleep 10
echo "Starting clvm"
service clvm start || report_err 'unable to start clvm'
sleep 5
echo "Starting gfs2"
service gfs2-cluster restart
service gfs2 start || report_err 'unable to start gfs2'
mount /dev/shared_vg/configurations /shared || report_err 'unable to mount /shared'
echo "Cluster succesfully started!"
====== stop_cluster.sh ======
#!/bin/bash
report_err(){
echo "$1"
}
echo "Stopping cluster..."
service rgmanager stop || report_err 'rgmanager stopping failed'
echo "rgmanager stopped!"
service gfs2 stop || report_err 'gfs2 stopping failed'
echo "gfs2 stopped!"
sleep 2
service clvm stop || report_err 'clvm stopping failed'
echo "CLVM stopped!"
sleep 5
killall fenced
cman_tool -wt10 leave remove || report_err 'leaving cluster failed'
service cman stop leave || report_err 'cman stopping failed'