Skip to content
Newer
Older
100755 59 lines (47 sloc) 1.48 KB
4786eae @jkreps Add cluster control scripts. Patch on http://code.google.com/p/projec…
jkreps authored
1 #!/bin/bash
2
3 #
4 # Copyright 2008-2009 bebo, Inc
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18
19 # Stops the local node. Note: As a future enhancement the PID of the current
20 # running voldemort server could be saved, so finding out, which Java process
21 # to end would be more reliable in case there are multiple Voldemort
22 # instances running on the same host under the same user. The PID would be
23 # ideally saved on a per config basis.
24
25
26 usage="Usage: voldemort-stop-all.sh [--config <conf-dir>]"
27
28 bin=`dirname "$0"`
29 bin=`cd "$bin"; pwd`
30
31 . "$bin/voldemort-config.sh"
32
33 if [ "$#" != "0" ] && [ "$#" != "2" ]
34 then
35 echo $usage
36 exit 1
37 fi
38
39 #check to see if the conf dir is given as an optional argument
40 if [ $# -eq 2 ]
41 then
42 if [ "--config" = "$1" ]
43 then
44 shift
45 confdir=$1
46 shift
47 VOL_CONF_DIR=$confdir
48 nodeid=$1
49 fi
50 fi
51
52 export HOSTLIST="$VOL_CONF_DIR/config/nodes"
53
54 for node in `cat "$HOSTLIST"`; do
55 ssh $VOL_SSH_OPTS $node "$bin/voldemort-stop.sh" &
56 done
57 wait
58
Something went wrong with that request. Please try again.