Project

General

Profile

fullrpm_install.sh

Script to install one-node gwms on fermicloud (osg-client uses rpms) - 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 rpms for osg-client
6
# Installs all services on one node
7

    
8
CERTFILE=/etc/grid-security/hostcert.pem
9
KEYFILE=/etc/grid-security/hostkey.pem
10
CONDOR=condor-7.6.6-x86_64_rhap_5-stripped.tar.gz
11
VERSION=branch_v2plus
12
HOSTNAME=`hostname`
13

    
14

    
15
#INSTALL epel
16
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-6.noarch.rpm
17
yum -y install yum-priorities
18
rpm -Uvh http://repo.grid.iu.edu/osg-el6-release-latest.rpm
19

    
20
#IMPORT VO FRONTEND PROXY
21
# CHANGE IF YOU ARE NOT dstrain
22
scp cms-xen25:/tmp/vo_proxy /tmp
23

    
24
#Add users
25
useradd wmscollector -d /opt/wmscollector
26
useradd wmsfactory -d /opt/wmsfactory
27
useradd usercollector -d /opt/usercollector
28
useradd userschedd -d /opt/userschedd
29
useradd vofrontend -d /opt/vofrontend
30

    
31
chmod 755 /opt/wmscollector
32
chmod 755 /opt/wmsfactory
33
chmod 755 /opt/usercollector
34
chmod 755 /opt/userschedd
35
chmod 755 /opt/vofrontend
36

    
37
mkdir -p /opt/vofrontend-condor
38
mkdir -p /opt/vofrontend-logs
39
mkdir -p /opt/components
40
mkdir -p /opt/components/osg-client
41
mkdir -p /opt/components/javascriptrrd-0.6.1
42
mkdir -p /opt/wmsfactory-client
43
mkdir -p /opt/wmsfactory-client/logs
44
mkdir -p /opt/wmsfactory-client/proxies
45
mkdir -p /opt/glideinWMS
46
mkdir -p /opt/glideinWMS/$VERSION
47

    
48
chown wmscollector:wmscollector /opt/wmscollector
49
chown usercollector:usercollector /opt/usercollector
50
chown userschedd:userschedd /opt/userschedd
51
chown -R vofrontend:vofrontend /opt/vofrontend
52
chown -R wmsfactory:wmsfactory /opt/wmsfactory
53
chown vofrontend:vofrontend /tmp/vo_proxy
54
chown -R vofrontend:vofrontend /opt/vofrontend-condor
55
chown -R vofrontend:vofrontend /opt/vofrontend-logs
56

    
57
#**** install PACMAN
58
#**** install OSG-CLIENT
59
yum -y install osg-ca-certs fetch-crl osg-client
60

    
61
fetch-crl
62

    
63
#**** install javascriptrrd
64
cd /opt/components
65
scp dstrain@fnalu.fnal.gov:~/packages/javascriptrrd-0.6.1-with-flot-0.7-tooltip-0.4.2.tgz .
66
sleep 2
67
tar xzvf javascriptrrd-0.6.1-with-flot-0.7-tooltip-0.4.2.tgz
68

    
69

    
70
#**** install APACHE
71
yum -y install httpd
72
mkdir -p /var/www/html/vofrontend
73
mkdir -p /var/www/html/wmsfactory
74
chown wmsfactory:wmsfactory /var/www/html/wmsfactory
75
chown vofrontend:vofrontend /var/www/html/vofrontend
76
sed -i "s/Listen 80/Listen 8000/" /etc/httpd/conf/httpd.conf
77
sed -i "s/ Indexes/ \-Indexes/" /etc/httpd/conf/httpd.conf
78
sed -i "s/Order allow,deny/Order deny,allow/" /etc/httpd/conf/httpd.conf
79
sed -i "s/^\s*Allow from all/Deny from all\nAllow from 131.225\nAllow from 2620:6a::\/48/" /etc/httpd/conf/httpd.conf
80
service httpd start
81

    
82
#install SOURCE
83
yum -y install git rrdtool-python
84
cd /opt/glideinWMS/$VERSION
85
git clone ssh://p-glideinwms@cdcvs.fnal.gov/cvs/projects/glideinwms
86
cd glideinwms
87
git checkout $VERSION
88

    
89
cd /opt/components
90
scp dstrain@fnalu.fnal.gov:~/packages/$CONDOR .
91
scp dstrain@fnalu.fnal.gov:~/packages/dstrain.ini .
92
sed -i "s/@HOSTNAME@/$HOSTNAME/" dstrain.ini
93
sed -i "s/@CONDOR_FILE@/$CONDOR/" dstrain.ini
94
sed -i "s/@VERSION@/$VERSION/" dstrain.ini
95

    
96

    
97
#add service certs
98
cp $CERTFILE /etc/grid-security/wmscollectorcert.pem
99
cp $KEYFILE /etc/grid-security/wmscollectorkey.pem
100
chown wmscollector:wmscollector /etc/grid-security/wmscollectorcert.pem
101
chown wmscollector:wmscollector /etc/grid-security/wmscollectorkey.pem
102
cp $CERTFILE /etc/grid-security/wmsfactorycert.pem
103
cp $KEYFILE /etc/grid-security/wmsfactorykey.pem
104
chown wmsfactory:wmsfactory /etc/grid-security/wmsfactorycert.pem
105
chown wmsfactory:wmsfactory /etc/grid-security/wmsfactorykey.pem
106
cp $CERTFILE /etc/grid-security/usercollectorcert.pem
107
cp $KEYFILE /etc/grid-security/usercollectorkey.pem
108
chown usercollector:usercollector /etc/grid-security/usercollectorcert.pem
109
chown usercollector:usercollector /etc/grid-security/usercollectorkey.pem
110
cp $CERTFILE /etc/grid-security/userscheddcert.pem
111
cp $KEYFILE /etc/grid-security/userscheddkey.pem
112
chown userschedd:userschedd /etc/grid-security/userscheddcert.pem
113
chown userschedd:userschedd /etc/grid-security/userscheddkey.pem
114
cp $CERTFILE /etc/grid-security/vofrontendcert.pem
115
cp $KEYFILE /etc/grid-security/vofrontendkey.pem
116
chown vofrontend:vofrontend /etc/grid-security/vofrontendcert.pem
117
chown vofrontend:vofrontend /etc/grid-security/vofrontendkey.pem
118

    
119

    
120
#INSTALL GLIDEINWMS
121
cd /opt/glideinWMS/$VERSION/glideinwms/install
122

    
123
./manage-glideins --install wmscollector --ini /opt/components/dstrain.ini
124
su wmsfactory -c "./manage-glideins --install factory --ini /opt/components/dstrain.ini"
125
./manage-glideins --install usercollector --ini /opt/components/dstrain.ini
126
./manage-glideins --install submit --ini /opt/components/dstrain.ini
127
chown -R vofrontend:vofrontend /opt/vofrontend-condor
128
chown -R vofrontend:vofrontend /opt/vofrontend-logs
129
su vofrontend -c "./manage-glideins --install vofrontend --ini /opt/components/dstrain.ini"
130

    
131

    
132

    
133

    
134