Project4/BIRNPortalIssues/sync grid

From CVRG Wiki

Jump to: navigation, search

Image:CVRG_wiki-90x48px.gif Project 4 - BIRNPortalIssues

#!/bin/sh

ENVIRONMENT=`perl -MVast::FindZone -e'print Vast::FindZone::find_zone()'`

if [ "x$ENVIRONMENT" = "xDevelopment" ]; then
        URL="http://bcc-dev-gama.nbirn.net/grid-mapfile";
elif [ "x$ENVIRONMENT" = "xStaging" ]; then
        URL="http://bcc-stage-gama.nbirn.net/grid-mapfile";
elif [ "x$ENVIRONMENT" = "xProduction" ]; then
        URL="http://gama.nbirn.net/grid-mapfile";
else
        echo "Unknown environment $ENVIRONMENT" >> /var/log/grid-security.log;
        exit 1;
fi;

/opt/BIRN/sbin/grid/sync-grid-accounts.prl --url=$URL --alter-mapfile --alter-accounts \
        >> /var/log/grid-security.log \
        2>/var/log/grid-security.err

chmod 644 /etc/grid-security/grid-mapfile
IPLIST=`mysql -u apache cluster -e "select IP from networks where Node = (select ID from nodes where Membership=13) AND Device=\"eth0\""`
IPS=`echo $IPLIST | sed -e 's/IP //'`
for IP in $IPS
do
    echo "transferring grid-mapfile to gcomp $IPLIST"
    scp /etc/grid-security/grid-mapfile $IP:/etc/grid-security/grid-mapfile
done
/opt/rocks/bin/cluster-fork --query="select Name from nodes where ID>1" "/opt/rocks/bin/411get --all"
Personal tools
Project Infrastructures