-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathambari_install.sh
executable file
·90 lines (67 loc) · 2.51 KB
/
ambari_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
#!/bin/bash
# Install Oracle Java 7 on AMBARI (e.g Admin) node.
#sudo yum -y install $JAVA_RPM_PATH ; java -version
sudo yum -y install httpd
mkdir -p /vagrant/tmp
chmod a+x /vagrant/generate-rsa-keys.sh
/vagrant/generate-rsa-keys.sh
cp -f /vagrant/tmp/id_rsa /root/.ssh/id_rsa
cp -f /vagrant/tmp/id_rsa /root/.ssh/id_rsa.pub
service httpd start
#create a staging folder
mkdir /staging
chmod a+rx /staging
#untar all the downloaded files in staging folder
for var in "$@"
do
if [[ "$var" == *.gz ]]
then
tar -xzf /vagrant/$var -C /staging/
else
tar -xf /vagrant/$var -C /staging/
fi
#filename=$(basename "$var")
#filename="${filename%.*}"
#/staging/$filename/setup_repo.sh
#tar -xzf /vagrant/AMBARI-1.7.1-87-centos6.tar -C /staging/
#tar -xzf /vagrant/PHD-3.0.0.0-249-centos6.tar -C /staging/
#tar -xzf /vagrant/PADS-1.3.0.0-12954.tar -C /staging/
#tar -xzf /vagrant/hawq-plugin-phd-1.0-57.tar.gz -C /staging
#tar -xzf /vagrant/PHD-UTILS-1.1.0.20-centos6.tar -C /staging
done
#making Ambari available in local yum repository
/staging/AMBARI-1.7.1/setup_repo.sh
#now installing ambari server. it will use local repository
yum -y install ambari-server
JDK_FILENAME=jdk-7u67-linux-x64.tar.gz
#copy jdk-7u67-linux-x64.gz to ambari resources directory
if [ ! -f /vagrant/$JDK_FILENAME ]; then
JDK_FILENAME=jdk-7u67-linux-x64.gz
fi
cp /vagrant/$JDK_FILENAME /var/lib/ambari-server/resources/jdk-7u67-linux-x64.tar.gz
chmod 644 /var/lib/ambari-server/resources/jdk-7u67-linux-x64.tar.gz
#copy UnlimitedJCEPolicyJDK7.zip to Ambari resources folder
cp /vagrant/UnlimitedJCEPolicyJDK7.zip /var/lib/ambari-server/resources/
chmod 644 /var/lib/ambari-server/resources/UnlimitedJCEPolicyJDK7.zip
#Run Ambari setup
ambari-server setup -s
sleep 10
#Start ambari server
ambari-server start
#Check ambari server status
ambari-server status
#Now setup all PHD components available in local yum repository
/staging/PHD-3.0.1.0/setup_repo.sh
/staging/hawq-plugin-phd-1.3.1/setup_repo.sh
/staging/PADS-1.3.1.1/setup_repo.sh
/staging/PHD-UTILS-1.1.0.20/setup_repo.sh
#http://ambari.localdomain/PHD-3.0.0.0
#http://ambari.localdomain/hawq-plugin-phd-1.0-57
#http://ambari.localdomain/PADS-1.3.0.0
#http://ambari.localdomain/PHD-UTILS-1.1.0.20
#Exporting yum ambari repository files
cp -f /etc/yum.repos.d/ambari.repo /vagrant/tmp
cp -f /etc/yum.repos.d/PHD-3.0.1.0.repo /vagrant/tmp
cp -f /etc/yum.repos.d/PADS.repo /vagrant/tmp
cp -f /etc/yum.repos.d/PHD-UTILS-1.1.0.20.repo /vagrant/tmp
cp -f /etc/yum.repos.d/hawq-plugin-phd-1.3.1.repo /vagrant/tmp