1
0
Fork 0

Merge branch 'devel' of github.com:arangodb/arangodb into devel

This commit is contained in:
Michael Hackstein 2016-09-20 13:56:47 +02:00
commit e52768c497
1 changed files with 95 additions and 53 deletions

View File

@ -1,23 +1,59 @@
#!/bin/bash #!/bin/bash
function help() {
echo "USAGE: scripts/startStandAloneAgency.sh [options]"
echo ""
echo "OPTIONS:"
echo " -a/--agency-size Agency size (odd integer default: 3))"
echo " -p/--pool-size Pool size (>= agency size default: [agency size])"
echo " -t/--transport Protocol (ssl|tcp default: tcp)"
echo " -l/--log-level Log level (INFO|DEBUG|TRACE default: INFO)"
echo ""
echo "EXAMPLES:"
echo " scripts/startStandaloneAgency.sh"
echo " scripts/startStandaloneAgency.sh -a 5 -p 10 -t ssl"
echo " scripts/startStandaloneAgency.sh --agency-size 3 --pool-size 5"
}
NRAGENTS=3 NRAGENTS=3
POOLSZ="" POOLSZ=""
TRANSPORT="tcp" TRANSPORT="tcp"
LOG_LEVEL="INFO" LOG_LEVEL="INFO"
while getopts ":a:p:t:l:" opt; do while [[ ${1} ]]; do
case $opt in case "${1}" in
a) NRAGENTS="$OPTARG" -a|--agency-size)
NRAGENTS=${2}
shift
;; ;;
p) POOLSZ="$OPTARG" -p|--pool-size)
POOLSZ=${2}
shift
;; ;;
t) TRANSPORT="$OPTARG" -t|--transport)
TRANSPORT=${2}
shift
;; ;;
l) LOG_LEVEL="$OPTARG" -l|--log-level)
LOG_LEVEL=${2}
shift
;; ;;
\?) echo "Invalid option -$OPTARG" >&2 -h|--help)
help
exit 1
;;
*)
echo "Unknown parameter: ${1}" >&2
help
exit 1
;; ;;
esac esac
if ! shift; then
echo 'Missing parameter argument.' >&2
return 1
fi
done done
if [ "$POOLSZ" == "" ] ; then if [ "$POOLSZ" == "" ] ; then
@ -26,13 +62,16 @@ fi
if [ "$TRANSPORT" == "ssl" ]; then if [ "$TRANSPORT" == "ssl" ]; then
SSLKEYFILE="--ssl.keyfile UnitTests/server.pem" SSLKEYFILE="--ssl.keyfile UnitTests/server.pem"
CURL="curl --insecure -ks https://"
else else
SSLKEYFILE="" SSLKEYFILE=""
CURL="curl -s http://"
fi fi
printf "agency-size: %s\n" "$NRAGENTS" printf "Starting agency ... \n"
printf "pool-size: %s\n" "$POOLSZ" printf " agency-size: %s," "$NRAGENTS"
printf "transport: %s\n" "$TRANSPORT" printf " pool-size: %s," "$POOLSZ"
printf " transport: %s," "$TRANSPORT"
printf " log-level: %s\n" "$LOG_LEVEL" printf " log-level: %s\n" "$LOG_LEVEL"
if [ ! -d arangod ] || [ ! -d arangosh ] || [ ! -d UnitTests ] ; then if [ ! -d arangod ] || [ ! -d arangosh ] || [ ! -d UnitTests ] ; then
@ -49,11 +88,11 @@ MINP=0.5
MAXP=2.0 MAXP=2.0
SFRE=2.5 SFRE=2.5
COMP=1000 COMP=1000
BASE=5001 BASE=5000
rm -rf agency rm -rf agency
mkdir -p agency mkdir -p agency
echo -n "Starting agency ... " PIDS=""
for aid in `seq 0 $(( $POOLSZ - 1 ))`; do for aid in `seq 0 $(( $POOLSZ - 1 ))`; do
port=$(( $BASE + $aid )) port=$(( $BASE + $aid ))
build/bin/arangod \ build/bin/arangod \
@ -81,9 +120,12 @@ for aid in `seq 0 $(( $POOLSZ - 1 ))`; do
--server.statistics false \ --server.statistics false \
$SSLKEYFILE \ $SSLKEYFILE \
> agency/$port.stdout 2>&1 & > agency/$port.stdout 2>&1 &
PIDS+=$!
PIDS+=" "
done done
echo "done." echo " done. Your agents are ready at port $BASE onward."
echo "Your agents are ready at port $BASE onward" #echo "Process ids: $PIDS"
echo "Try ${CURL}localhost:5000/_api/agency/config."