-
Notifications
You must be signed in to change notification settings - Fork 4
/
stop_solution
executable file
·53 lines (46 loc) · 1.13 KB
/
stop_solution
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
#!/bin/bash
usage() {
echo "usage: $(basename $0) --sd <solution definition file name>"
exit 1;
}
while [ ! -z $2 ]; do
case "$1" in
--sd ) solution_def_file=$2 ;;
* ) usage ;;
esac
shift
done
echo "solution definition file="$solution_def_file
stop_service(){
service_name=$1
dep_service="$2"
bd_ip=$3
bd_user=$4
namenode=$5
resourcemanager=$6
sparkmaster=$7
server=root@$bd_ip
if [ "$dep_service" != "none" ] ; then
for i in $dep_service
do
ssh $server "$i/stop.sh" < /dev/null
done
fi
ssh $server "$service_name/stop.sh" < /dev/null
}
while IFS=',' read -r f1 f2 f3 f4 f5 f6 f7
do
## Ignore lines start with "#"
case $f1 in
\#*) continue;;
"") continue;;
esac
echo "************************************** "
echo "Service Name="$f1
echo " Required Service="$f2
echo " Service Location="$f3
echo " Service User Name="$f4
echo "************************************** "
stop_service $f1 "$f2" $f3 $f4 $f5 $f6 $f7
done < "$solution_def_file"
./solution_status --sd $solution_def_file