-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·207 lines (161 loc) · 6.46 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#!/bin/bash
apt-get update
apt-get upgrade
# List of necessary packages
LIST_OF_APPS="ssh ntp qt-sdk pkg-config ncurses-dev nfs-server libselinux1-dev pdsh tftp gfortran
libxml2-dev libboost-dev tk-dev apache2 libapache2-mod-perl2 tftpd-hpa debootstrap tcpdump
isc-dhcp-server curl libterm-readline-gnu-perl apache2 php5 php5-mysql libapache2-mod-php5
ganglia-monitor rrdtool gmetad ganglia-webfrontend libmunge-dev libmunge2 munge"
# current directory for reference
DIR=$( pwd )
# set up permanent networking connections
mv -f /etc/network/interfaces /etc/network/interfaces.og
cp -f $DIR/configFiles/interfaces /etc/network/interfaces
/etc/init.d/networking restart
#install essential build tools:
apt-get install -y build-essential
# install mariadb (new, updated mysql):
apt-get install -y mysql-server mysql-client
# install other important packages:
apt-get install -y $LIST_OF_APPS
# set selinux to permisive
mv -f /etc/selinux/config /etc/selinux/config.og
cp -f $( pwd )/configFiles/config /etc/selinux/config
setenforce 0
# Build and install MPICH
cd $DIR/mpich
tar zxvf mpich-3.2.1.tar.gz
cd mpich-3.2.1
./configure --enable-fc --enable-f77 --enable-romio --enable-mpe --with-pm=hydra
# make & install
make
make install
cd $DIR
# install warewulf
cd $DIR/src
chmod +x install-wwdebsystem
./install-wwdebsystem 3.6
cd $DIR
# make copy of original config files then move these into place
mv -f /etc/exports /etc/exports.og
cp -f $DIR/configFiles/exports /etc/exports
mv -f /usr/local/libexec/warewulf/wwmkchroot/include-deb /usr/local/libexec/warewulf/wwmkchroot/include-deb.og
cp -f $DIR/configFiles/include-deb /usr/local/libexec/warewulf/wwmkchroot/include-deb
mv -f /usr/local/etc/warewulf/vnfs.conf /usr/local/etc/warewulf/vnfs.conf.og
cp -f $DIR/configFiles/vnfs.conf /usr/local/etc/warewulf/vnfs.conf
cp -f $DIR/configFiles/debian7.tmpl /usr/local/libexec/warewulf/wwmkchroot/debian7.tmpl
# cp ganglia config files
cp /etc/ganglia-webfrontend/apache.conf /etc/apache2/sites-enabled/ganglia.conf
mv -f /etc/ganglia/gmetad.conf /etc/ganglia/gmetad.conf.og
cp -f $DIR/configFiles/gmetad.conf /etc/ganglia/gmetad.conf
mv -f /etc/ganglia/gmond.conf /etc/ganglia/gmond.conf.og
cp -f $DIR/configFiles/gmond.conf /etc/ganglia/gmond.conf
# start ganglia services
/etc/init.d/ganglia-monitor start
/etc/init.d/gmetad start
#/etc/init.d/apache2 restart
# Create directories necessary for successful chrooting:
mkdir /srv/chroots
mkdir /srv/chroots/debian7
mkdir /srv/chroots/debian7/vnfs
mkdir /srv/chroots/debian7/srv
mkdir /srv/chroots/debian7/srv/chroots
# create warewulf chroot:
wwmkchroot debian7 /srv/chroots/debian7
# make copy of original config files then move these into place
mv -f /etc/idmapd.conf /etc/idmapd.conf.og
mv -f /srv/chroots/debian7/etc/idmapd.conf /srv/chroots/debian7/etc/idmapd.conf.og
cp -f $DIR/configFiles/idmapd.conf /etc/idmapd.conf
cp -f $DIR/configFiles/idmapd.conf /srv/chroots/debian7/etc/idmapd.conf
mv -f /etc/default/nfs-common /etc/default/nfs-common.og
cp -f $DIR/configFiles/nfs-common /etc/default/nfs-common
mv -f /usr/local/etc/warewulf/defaults/node.conf /usr/local/etc/warewulf/defaults/node.conf.og
cp -f $DIR/configFiles/node.conf /usr/local/etc/warewulf/defaults/node.conf
mv -f /usr/local/etc/warewulf/defaults/provision.conf /usr/local/etc/warewulf/defaults/provision.conf.og
cp -f $DIR/configFiles/provision.conf /usr/local/etc/warewulf/defaults/provision.conf
mv -f /usr/local/etc/warewulf/bootstrap.conf /usr/local/etc/warewulf/bootstrap.conf.og
cp -f $DIR/configFiles/bootstrap.conf /usr/local/etc/warewulf/bootstrap.conf
mv -f /srv/chroots/debian7/etc/fstab /srv/chroots/debian7/etc/fstab.og
cp -f $DIR/configFiles/fstab /srv/chroots/debian7/etc/fstab
mv -f /srv/chroots/debian7/etc/rc.local /srv/chroots/debian7/etc/rc.local.og
cp -f $DIR/configFiles/rc.local /srv/chroots/debian7/etc/rc.local
# restart nfs on master node
/etc/init.d/nfs-kernel-server restart
/etc/init.d/nfs-common restart
# Verify the appropriate nfs filesystems are being exported by the master node:
showmount -e 10.253.1.254
# Restart the tftp server:
/etc/init.d/tftpd-hpa restart
# Build chroot environment and install:
wwvnfs --chroot /srv/chroots/debian7 --hybridpath=/vnfs
wwsh dhcp update
# into chroot
cp -rf $DIR/slurm-18 /srv/chroots/debian7/slurm-18
# put ./chroot.sh & slurm.sh in place
cp $DIR/configFiles/chroot.sh /srv/chroots/debian7/chroot.sh
cp $DIR/configFiles/slurm.sh /srv/chroots/debian7/slurm.sh
# update sources
mv -f /srv/chroots/debian7/etc/apt/sources.list /srv/chroots/debian7/etc/apt/sources.list.og
cp -f $DIR/configFiles/sources.list /srv/chroots/debian7/etc/apt/sources.list
# We want the clocks to be the same on all nodes (synchronized)
mv -f /srv/chroots/debian7/etc/ntp.conf /srv/chroots/debian7/etc/ntp.conf.og
cp -f $DIR/configFiles/ntp.conf /srv/chroots/debian7/etc/ntp.conf
# move ganglia config into place
mv -f /srv/chroots/debian7/etc/ganglia/gmond.conf /srv/chroots/debian7/etc/ganglia/gmond.conf.og
cp -f $DIR/configFiles/clientGmond.conf /srv/chroots/debian7/etc/ganglia/gmond.conf
# update debian7 vnfs (magic land)
chroot /srv/chroots/debian7 ./chroot.sh
# build image
wwvnfs --chroot /srv/chroots/debian7 --hybridpath=/vnfs
# update the files and everything else!!!!!
wwsh file sync
wwsh dhcp update
wwsh pxe update
echo 'success'
# add nodes
n=1
echo -n "Would you like to add n000$n? yes/no : "
read ADD
until [ "$ADD" == "no" ]
do
echo -n "Enter the MAC address of n000$n: "
read MAC
wwsh node new n000$n --hwaddr=$MAC --ipaddr=10.253.1.$n
let 'n++';ADD=''
until [ "$ADD" == "yes" ] || [ "$ADD" == "no" ]
do
echo -n "Would you like to add n000$n? yes/no : "
read ADD
done
done
# slurm
cd $DIR/slurm-18
./configure
make
make install
cd $DIR
# get slurm in magic land
chroot /srv/chroots/debian7 ./slurm.sh
# get slurm.conf in place
cp -f $DIR/configFiles/slurm.conf /usr/local/etc/slurm.conf
cp -f $DIR/configFiles/slurm.conf /srv/chroots/debian7/usr/local/slurm.conf
chown slurm:slurm /srv/chroots/debian7/usr/local/slurm.conf
chown slurm:slurm /usr/local/slurm.conf
# update the files and everything else!!!!!
wwsh file sync
wwsh dhcp update
wwsh pxe update
echo 'success'
# ask to reboot
until [ "$ANS" == "yes" ] || [ "$ANS" == "no" ]
do
echo -n 'Would you like to reboot? yes/no : '
read ANS
done
if [ "$ANS" == "yes" ];
then
# reboot
echo 'System will now reboot to finish install'
sleep 5s; shutdown -r now
fi
echo 'ok byyyyye'