forked from Alluxio/alluxio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtachyon-stop.sh
executable file
·59 lines (50 loc) · 1.08 KB
/
tachyon-stop.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
#!/usr/bin/env bash
LAUNCHER=
# If debugging is enabled propagate that through to sub-shells
if [[ "$-" == *x* ]]; then
LAUNCHER="bash -x"
fi
Usage="Usage: tachyon-stop.sh [-h] [component]
Where component is one of:
all\t\t\tStop local master/worker and remote workers. Default.
master\t\tStop local master.
worker\t\tStop local worker.
workers\t\tStop local worker and all remote workers.
-h display this help."
bin=`cd "$( dirname "$0" )"; pwd`
kill_master() {
$LAUNCHER $bin/tachyon killAll tachyon.master.TachyonMaster
}
kill_worker() {
$LAUNCHER $bin/tachyon killAll tachyon.worker.TachyonWorker
}
kill_remote_workers() {
$LAUNCHER $bin/tachyon-workers.sh $bin/tachyon killAll tachyon.worker.TachyonWorker
}
WHAT=${1:-all}
case "$WHAT" in
master)
kill_master
;;
worker)
kill_worker
;;
workers)
kill_worker
kill_remote_workers
;;
all)
kill_master
kill_worker
kill_remote_workers
;;
-h)
echo -e "$Usage"
exit 0
;;
*)
echo "Error: Invalid component: $WHAT"
echo -e "$Usage"
exit 1
;;
esac