2013-12-22 23:44:26 -05:00
|
|
|
#!/bin/bash
|
2012-01-25 14:49:26 -05:00
|
|
|
|
2013-12-22 23:44:26 -05:00
|
|
|
numServers=$1
|
|
|
|
baseJettyPort=7572
|
|
|
|
baseStopPort=6572
|
|
|
|
|
|
|
|
die () {
|
|
|
|
echo >&2 "$@"
|
|
|
|
exit 1
|
|
|
|
}
|
2012-01-25 14:49:26 -05:00
|
|
|
|
2013-12-22 23:44:26 -05:00
|
|
|
[ "$#" -eq 1 ] || die "1 argument required, $# provided, usage: solrcloud-start-exisiting.sh {numServers}"
|
2012-01-25 14:49:26 -05:00
|
|
|
|
|
|
|
|
2013-12-22 23:44:26 -05:00
|
|
|
cd ..
|
2012-01-25 14:49:26 -05:00
|
|
|
|
2013-12-22 23:44:26 -05:00
|
|
|
cd example1
|
|
|
|
echo "starting example1"
|
|
|
|
java -DzkRun -DSTOP.PORT=7983 -DSTOP.KEY=key -jar start.jar 1>example1.log 2>&1 &
|
2012-01-25 14:49:26 -05:00
|
|
|
|
|
|
|
|
2013-12-22 23:44:26 -05:00
|
|
|
for (( i=2; i <= $numServers; i++ ))
|
|
|
|
do
|
|
|
|
echo "starting example$i"
|
|
|
|
cd ../example$i
|
|
|
|
stopPort=`expr $baseStopPort + $i`
|
|
|
|
jettyPort=`expr $baseJettyPort + $i`
|
|
|
|
java -Xmx1g -Djetty.port=$jettyPort -DzkHost=localhost:9983 -DnumShards=1 -DSTOP.PORT=$stopPort -DSTOP.KEY=key -jar start.jar 1>example$i.log 2>&1 &
|
|
|
|
done
|