Project

General

Profile

full_install.sh

Script to install one-node gwms on fermicloud - Douglas Strain, 01/29/2013 11:01 AM

 
1
#!/bin/bash
2

    
3
# Script to install glideinwms on a clean VM, such as fermicloud
4
#
5
# Uses ini installer and pacman for osg-client
6
# Installs all services on one node
7

    
8
#Note, uses scp to copy condor files
9
#Make sure to set up a location to copy these from
10

    
11

    
12
CERTFILE=/etc/grid-security/hostcert.pem
13
KEYFILE=/etc/grid-security/hostkey.pem
14
CONDOR=condor-7.6.6-x86_64_rhap_5-stripped.tar.gz
15
VERSION=branch_v2plus
16
HOSTNAME=`hostname`
17

    
18

    
19
#INSTALL epel
20
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
21
rpm -i epel-release-5-4.noarch.rpm
22

    
23
#IMPORT VO FRONTEND PROXY
24
# CHANGE IF YOU ARE NOT dstrain
25
scp cms-xen25:/tmp/vo_proxy /tmp
26

    
27
#Add users
28
useradd wmscollector -d /opt/wmscollector
29
useradd wmsfactory -d /opt/wmsfactory
30
useradd usercollector -d /opt/usercollector
31
useradd userschedd -d /opt/userschedd
32
useradd vofrontend -d /opt/vofrontend
33

    
34
chmod 755 /opt/wmscollector
35
chmod 755 /opt/wmsfactory
36
chmod 755 /opt/usercollector
37
chmod 755 /opt/userschedd
38
chmod 755 /opt/vofrontend
39

    
40
mkdir -p /opt/vofrontend-condor
41
mkdir -p /opt/vofrontend-logs
42
mkdir -p /opt/components
43
mkdir -p /opt/components/osg-client
44
mkdir -p /opt/components/javascriptrrd-0.6.1
45
mkdir -p /opt/components/pacman-3.28
46
mkdir -p /opt/wmsfactory-client
47
mkdir -p /opt/wmsfactory-client/logs
48
mkdir -p /opt/wmsfactory-client/proxies
49
mkdir -p /opt/glideinWMS
50
mkdir -p /opt/glideinWMS/$VERSION
51

    
52
chown wmscollector:wmscollector /opt/wmscollector
53
chown usercollector:usercollector /opt/usercollector
54
chown userschedd:userschedd /opt/userschedd
55
chown -R vofrontend:vofrontend /opt/vofrontend
56
chown -R wmsfactory:wmsfactory /opt/wmsfactory
57
chown vofrontend:vofrontend /tmp/vo_proxy
58
chown -R vofrontend:vofrontend /opt/vofrontend-condor
59
chown -R vofrontend:vofrontend /opt/vofrontend-logs
60

    
61
#**** install PACMAN
62
cd /opt/components
63
wget http://vdt.cs.wisc.edu/software/pacman/3.28/pacman-3.28.tar.gz
64
tar zvxf pacman-3.28.tar.gz
65
cd /opt/components/pacman-3.28
66
source /opt/components/pacman-3.28/setup.sh
67
#**** install OSG-CLIENT
68
cd /opt/components/osg-client
69
pacman -get http://software.grid.iu.edu/osg-1.2:client -allow trust-all-caches
70
source setup.sh
71
vdt-post-install
72
source setup.sh
73
vdt-ca-manage setupca --location root --url osg
74
vdt-control --enable fetch-crl vdt-update-certs
75
vdt-control --on fetch-crl vdt-update-certs
76
/opt/components/osg-client/fetch-crl/share/doc/fetch-crl-2.8.5/fetch-crl.cron
77

    
78

    
79
#**** install javascriptrrd
80
cd /opt/components
81
scp dstrain@fnalu.fnal.gov:~/packages/javascriptrrd-0.6.1-with-flot-0.7-tooltip-0.4.2.tgz .
82
sleep 2
83
tar xzvf javascriptrrd-0.6.1-with-flot-0.7-tooltip-0.4.2.tgz
84

    
85

    
86
#**** install APACHE
87
yum -y install httpd
88
mkdir -p /var/www/html/vofrontend
89
mkdir -p /var/www/html/wmsfactory
90
chown wmsfactory:wmsfactory /var/www/html/wmsfactory
91
chown vofrontend:vofrontend /var/www/html/vofrontend
92
sed -i "s/Listen 80/Listen 8000/" /etc/httpd/conf/httpd.conf
93
sed -i "s/ Indexes/ \-Indexes/" /etc/httpd/conf/httpd.conf
94
sed -i "s/Order allow,deny/Order deny,allow/" /etc/httpd/conf/httpd.conf
95
sed -i "s/^\s*Allow from all/Deny from all\nAllow from 131.225\nAllow from 2620:6a::\/48/" /etc/httpd/conf/httpd.conf
96
service httpd start
97

    
98
#install SOURCE
99
yum -y install git rrdtool-python
100
cd /opt/glideinWMS/$VERSION
101
git clone ssh://p-glideinwms@cdcvs.fnal.gov/cvs/projects/glideinwms
102
cd glideinwms
103
git checkout $VERSION
104

    
105
cd /opt/components
106
scp dstrain@fnalu.fnal.gov:~/packages/$CONDOR .
107
scp dstrain@fnalu.fnal.gov:~/packages/dstrain.ini .
108
sed -i "s/@HOSTNAME@/$HOSTNAME/" dstrain.ini
109
sed -i "s/@CONDOR_FILE@/$CONDOR/" dstrain.ini
110
sed -i "s/@VERSION@/$VERSION/" dstrain.ini
111

    
112

    
113
#add service certs
114
cp $CERTFILE /etc/grid-security/wmscollectorcert.pem
115
cp $KEYFILE /etc/grid-security/wmscollectorkey.pem
116
chown wmscollector:wmscollector /etc/grid-security/wmscollectorcert.pem
117
chown wmscollector:wmscollector /etc/grid-security/wmscollectorkey.pem
118
cp $CERTFILE /etc/grid-security/wmsfactorycert.pem
119
cp $KEYFILE /etc/grid-security/wmsfactorykey.pem
120
chown wmsfactory:wmsfactory /etc/grid-security/wmsfactorycert.pem
121
chown wmsfactory:wmsfactory /etc/grid-security/wmsfactorykey.pem
122
cp $CERTFILE /etc/grid-security/usercollectorcert.pem
123
cp $KEYFILE /etc/grid-security/usercollectorkey.pem
124
chown usercollector:usercollector /etc/grid-security/usercollectorcert.pem
125
chown usercollector:usercollector /etc/grid-security/usercollectorkey.pem
126
cp $CERTFILE /etc/grid-security/userscheddcert.pem
127
cp $KEYFILE /etc/grid-security/userscheddkey.pem
128
chown userschedd:userschedd /etc/grid-security/userscheddcert.pem
129
chown userschedd:userschedd /etc/grid-security/userscheddkey.pem
130
cp $CERTFILE /etc/grid-security/vofrontendcert.pem
131
cp $KEYFILE /etc/grid-security/vofrontendkey.pem
132
chown vofrontend:vofrontend /etc/grid-security/vofrontendcert.pem
133
chown vofrontend:vofrontend /etc/grid-security/vofrontendkey.pem
134

    
135

    
136
#INSTALL GLIDEINWMS
137
cd /opt/glideinWMS/$VERSION/glideinwms/install
138

    
139
./manage-glideins --install wmscollector --ini /opt/components/dstrain.ini
140
su wmsfactory -c "./manage-glideins --install factory --ini /opt/components/dstrain.ini"
141
./manage-glideins --install usercollector --ini /opt/components/dstrain.ini
142
./manage-glideins --install submit --ini /opt/components/dstrain.ini
143
chown -R vofrontend:vofrontend /opt/vofrontend-condor
144
chown -R vofrontend:vofrontend /opt/vofrontend-logs
145
su vofrontend -c "./manage-glideins --install vofrontend --ini /opt/components/dstrain.ini"
146

    
147

    
148

    
149

    
150