Rocks Utilities

From BeSTGRID

Jump to: navigation, search

[edit] Scripts

script to propagate updates from yum to compute nodes. stolen from rocks mailing list, author Travis Daygale. [1]

#!/bin/bash

# 
# this script copies packages cached by yum so that the rocks distro can be updated too (head node rev levels ! = rocks distro rev levels)
# 
# there might be better ways to do this, but for now...

# Change this as necessary:
RocksDistro=/home/install/contrib/4.2.1/x86_64/RPMS/

if [ ! -d $RocksDistro ]
then
echo "No directory $RocksDistro, are you sure this is a rocks node?"
echo "No changes made, aborting"
exit
fi


for yumcache in `find /var/cache/yum/ -name packages -type d -print`
do
cd $yumcache
tar cf - . | (cd $RocksDistro; tar xf -)
echo "Copied all packages from $yumcache to $RocksDistro"
done

echo "Recreating the Rocks distro using rocks-dist"
cd /home/install
/opt/rocks/bin/rocks-dist dist

To re-install all compute nodes:

 cluster-fork /boot/kickstart/cluster-kickstart

To synchronize users on compute nodes:

rocks-user-sync 


Script to install new roll on existing cluster (given for bio roll, but others are similar)

 su - root
 mount -o loop bio.iso /mnt/cdrom
 cd /home/install
 rocks-dist --install copyroll
 umount /mnt/cdrom
 rocks-dist dist
 kroll bio | bash
 init 6
 cluster-fork /boot/kickstart/cluster-kickstart