summaryrefslogtreecommitdiffstats
path: root/testsuites/rubbos/rubbos_scripts/1-1-1/scripts/run.sh
blob: 47cec3ad63deae4ab693078d72cdc5577a72aaca (plain)
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
#!/bin/bash
##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

set -x

cd /bottlenecks/rubbos/rubbos_scripts/1-1-1
source set_bottlenecks_rubbos_env.sh
cd /bottlenecks/rubbos/rubbos_scripts/1-1-1/scripts
# Transfer all sub scripts to target hosts
echo "*** scp scripts *************************************************"

scp_options="-o StrictHostKeyChecking=no -o BatchMode=yes"

scp $scp_options CONTROL_rubbos_exec.sh  $CONTROL_HOST:/tmp

if true; then
for script in BENCHMARK_rubbos_install.sh BENCHMARK_install.sh \
              BENCHMARK_configure.sh BENCHMARK_uninstall.sh \
              BENCHMARK_rubbos_uninstall.sh
do
    scp $scp_options $script $BENCHMARK_HOST:/tmp
done
fi

if true; then
for i in {1..4}
do
    for script in CLIENT${i}_rubbos_install.sh CLIENT${i}_install.sh \
                  CLIENT${i}_configure.sh CLIENT${i}_uninstall.sh \
                  CLIENT${i}_rubbos_uninstall.sh
    do
        CLIENT_HOST=`printenv CLIENT${i}_HOST`
        scp $scp_options $script $CLIENT_HOST:/tmp
    done
done
fi

if true; then
for script in HTTPD_install.sh HTTPD_rubbos_install.sh \
              HTTPD_configure.sh HTTPD_ignition.sh \
              HTTPD_stop.sh HTTPD_rubbos_uninstall.sh \
              HTTPD_uninstall.sh
do
    scp $scp_options $script $HTTPD_HOST:/tmp
done
fi

if true; then
for script in TOMCAT1_install.sh TOMCAT1_rubbos_install.sh \
              TOMCAT1_configure.sh TOMCAT1_rubbosSL_configure.sh \
              TOMCAT1_ignition.sh TOMCAT1_stop.sh \
              TOMCAT1_rubbos_uninstall.sh TOMCAT1_uninstall.sh
do
    scp $scp_options $script $TOMCAT1_HOST:/tmp
done
fi

if true; then
for script in MYSQL1_install.sh MYSQL1_rubbos_install.sh \
              MYSQL1_configure.sh MYSQL1_reset.sh \
              MYSQL1_ignition.sh MYSQL1_stop.sh \
              MYSQL1_rubbos_uninstall.sh \
              MYSQL1_uninstall.sh
do
    scp $scp_options $script $MYSQL1_HOST:/tmp
done
fi

# Prepare software packages
echo "*** prepare software packages ***"
./MYSQL1_pkg_prepare.sh
./TOMCAT1_pkg_prepare.sh
./HTTPD_pkg_prepare.sh
./BENCHMARK_pkg_prepare.sh
for i in {1..4}
do
    ./CLIENT${i}_pkg_prepare.sh
done

# Install and Configure and run Apache, Tomcat, CJDBC, and MySQL
echo "*** install scripts & configure & execute ***********************"

ssh root@$MYSQL1_HOST chmod 770 /tmp/MYSQL1_install.sh
ssh $MYSQL1_HOST /tmp/MYSQL1_install.sh

ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_install.sh
ssh $TOMCAT1_HOST /tmp/TOMCAT1_install.sh

ssh root@$HTTPD_HOST chmod 770 /tmp/HTTPD_install.sh
ssh $HTTPD_HOST /tmp/HTTPD_install.sh

ssh root@$MYSQL1_HOST chmod 770 /tmp/MYSQL1_rubbos_install.sh
ssh $MYSQL1_HOST /tmp/MYSQL1_rubbos_install.sh

ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_rubbos_install.sh
ssh $TOMCAT1_HOST /tmp/TOMCAT1_rubbos_install.sh

ssh root@$HTTPD_HOST chmod 770 /tmp/HTTPD_rubbos_install.sh
ssh $HTTPD_HOST /tmp/HTTPD_rubbos_install.sh

ssh root@$BENCHMARK_HOST chmod 770 /tmp/BENCHMARK_rubbos_install.sh
ssh $BENCHMARK_HOST /tmp/BENCHMARK_rubbos_install.sh

for i in {1..4}
do
    CLIENT_HOST=`printenv CLIENT${i}_HOST`
    ssh root@$CLIENT_HOST chmod 770 /tmp/CLIENT${i}_rubbos_install.sh
    ssh $CLIENT_HOST /tmp/CLIENT${i}_rubbos_install.sh
done

ssh root@$BENCHMARK_HOST chmod 770 /tmp/BENCHMARK_install.sh
ssh $BENCHMARK_HOST /tmp/BENCHMARK_install.sh

for i in {1..4}
do
    CLIENT_HOST=`printenv CLIENT${i}_HOST`
    ssh root@$CLIENT_HOST chmod 770 /tmp/CLIENT${i}_install.sh
    ssh $CLIENT_HOST /tmp/CLIENT${i}_install.sh
done

ssh root@$MYSQL1_HOST chmod 770 /tmp/MYSQL1_configure.sh
ssh $MYSQL1_HOST /tmp/MYSQL1_configure.sh &
sleep 60

ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_configure.sh
ssh $TOMCAT1_HOST /tmp/TOMCAT1_configure.sh

ssh root@$HTTPD_HOST chmod 770 /tmp/HTTPD_configure.sh
ssh $HTTPD_HOST /tmp/HTTPD_configure.sh

ssh root@$BENCHMARK_HOST chmod 770 /tmp/BENCHMARK_configure.sh
ssh $BENCHMARK_HOST /tmp/BENCHMARK_configure.sh

for i in {1..4}
do
    CLIENT_HOST=`printenv CLIENT${i}_HOST`
    ssh root@$CLIENT_HOST chmod 770 /tmp/CLIENT${i}_configure.sh
    ssh $CLIENT_HOST /tmp/CLIENT${i}_configure.sh
done

ssh root@$TOMCAT1_HOST chmod 770 /tmp/TOMCAT1_rubbosSL_configure.sh
ssh $TOMCAT1_HOST /tmp/TOMCAT1_rubbosSL_configure.sh

ssh $CONTROL_HOST /tmp/CONTROL_rubbos_exec.sh

set +x