-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6901 from yehudasa/wip-mstart
vstart.sh: add mstart, mstop, mrun wrappers for running multiple vstart-style test clusters out of src tree Reviewed-by: Sage Weil <sage@redhat.com>
- Loading branch information
Showing
5 changed files
with
133 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
script_root=`dirname $0` | ||
|
||
[ "$#" -lt 2 ] && echo "usage: $0 <name> <port> [params...]" && exit 1 | ||
|
||
name=$1 | ||
port=$2 | ||
|
||
shift 2 | ||
|
||
run_root=$script_root/run/$name | ||
pidfile=$run_root/out/radosgw.${port}.pid | ||
|
||
$script_root/mstop.sh $name radosgw $port | ||
|
||
$script_root/mrun $name radosgw --rgw-frontends="civetweb port=$port" --pid-file=$pidfile "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
[ $# -lt 2 ] && echo "usage: $0 <name> <command> [params...]" && exit 1 | ||
|
||
root=`dirname $0` | ||
run_name=$1 | ||
command=$2 | ||
|
||
shift 2 | ||
|
||
$root/$command -c $root/run/$run_name/ceph.conf "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
|
||
usage="usage: $0 <name> [vstart options]..\n" | ||
|
||
usage_exit() { | ||
printf "$usage" | ||
exit | ||
} | ||
|
||
[ $# -lt 1 ] && usage_exit | ||
|
||
|
||
instance=$1 | ||
shift | ||
|
||
root_path=`dirname $0` | ||
root_path=`(cd $root_path; pwd)` | ||
RUN_ROOT_PATH=${root_path}/run | ||
CLUSTERS_LIST=$RUN_ROOT_PATH/.clusters.list | ||
|
||
mkdir -p $RUN_ROOT_PATH | ||
|
||
|
||
if [ ! -f $CLUSTERS_LIST ]; then | ||
touch $CLUSTERS_LIST | ||
fi | ||
|
||
pos=`grep -n -w $instance $CLUSTERS_LIST` | ||
if [ $? -ne 0 ]; then | ||
echo $instance >> $CLUSTERS_LIST | ||
pos=`grep -n -w $instance $CLUSTERS_LIST` | ||
fi | ||
|
||
pos=`echo $pos | cut -d: -f1` | ||
base_port=$((6800+pos*10)) | ||
|
||
export VSTART_DEST=$RUN_ROOT_PATH/$instance | ||
export CEPH_PORT=$base_port | ||
|
||
mkdir -p $VSTART_DEST | ||
|
||
echo "Cluster dest path: $VSTART_DEST" | ||
echo "monitors base port: $CEPH_PORT" | ||
|
||
$root_path/vstart.sh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
script_root=`dirname $0` | ||
|
||
[ "$#" -lt 1 ] && echo "usage: $0 <name> [entity [id]]" && exit 1 | ||
|
||
name=$1 | ||
entity=$2 | ||
id=$3 | ||
|
||
run_root=$script_root/run/$name | ||
pidpath=$run_root/out | ||
|
||
if [ "$entity" == "" ]; then | ||
pfiles=`ls $pidpath/*.pid` || true | ||
elif [ "$id" == "" ]; then | ||
pfiles=`ls $pidpath/$entity.*.pid` || true | ||
else | ||
pfiles=`ls $pidpath/$entity.$id.pid` || true | ||
fi | ||
|
||
for pidfile in $pfiles; do | ||
pid=`cat $pidfile` | ||
fname=`echo $pidfile | sed 's/.*\///g'` | ||
echo $pid | ||
[ "$pid" == "" ] && exit | ||
[ $pid -eq 0 ] && exit | ||
echo pid=$pid | ||
extra_check="" | ||
entity=`echo $fname | sed 's/\..*//g'` | ||
[ "$entity" == "radosgw" ] && extra_check="-e lt-radosgw" | ||
echo entity=$entity pid=$pid | ||
while ps -p $pid -o args= | grep -q -e $entity $extracheck ; do | ||
cmd="kill $signal $pid" | ||
printf "$cmd..." | ||
$cmd | ||
sleep 1 | ||
continue | ||
done | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters