forked from tzolov/vagrant-pivotalhd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare_all_nodes.sh
executable file
·34 lines (25 loc) · 1017 Bytes
/
prepare_all_nodes.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
#!/bin/bash
# Remove any pre-installed Ruby or Puppet packages to avoid
# conflicts with Ruby/Puppet packages installed by PCC.
yum -y remove puppet ruby facter ruby-augeas ruby-libs libselinux-ruby
# Install the packages required for all cluster and admin nodes
yum -y install postgresql-devel nc expect ed ntp dmidecode pciutils libgfortran wget unzip emacs
# Set timezone and run NTP (set to Europe - Amsterdam time).
/etc/init.d/ntpd stop;
mv /etc/localtime /etc/localtime.bak;
ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime;
/etc/init.d/ntpd start
# Create and set the hosts file like:
#
# 10.211.55.100 pcc.localdomain pcc
# 10.211.55.101 phd1.localdomain phd1
# ...
# 10.211.55.10N phdN.localdomain phdN
cat > /etc/hosts <<EOF
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
10.211.55.100 pcc.localdomain pcc
EOF
for i in $(eval echo {1..$1}); do
echo "10.211.55.$((100 + $i)) phd$i.localdomain phd$i" >> /etc/hosts
done