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
|
2014-08-06 12:46:31 -04:00
|
|
|
|
|
|
|
baseJettyPort=8900
|
|
|
|
baseStopPort=9900
|
2013-12-22 23:44:26 -05:00
|
|
|
|
2014-08-29 08:30:53 -04:00
|
|
|
ZK_CHROOT="solr"
|
|
|
|
|
2013-12-22 23:44:26 -05:00
|
|
|
die () {
|
|
|
|
echo >&2 "$@"
|
|
|
|
exit 1
|
|
|
|
}
|
2012-01-25 14:49:26 -05:00
|
|
|
|
2014-08-06 12:46:31 -04: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
|
|
|
|
2014-12-02 12:41:30 -05:00
|
|
|
cd serverzk
|
2014-08-06 12:46:31 -04:00
|
|
|
stopPort=1313
|
|
|
|
jettyPort=8900
|
2014-12-02 12:41:30 -05:00
|
|
|
exec -a jettyzk java -Xmx512m $JAVA_OPTS -Djetty.port=$jettyPort -DhostPort=$jettyPort -DzkRun -DzkHost=localhost:9900/$ZK_CHROOT -DzkRunOnly=true -DSTOP.PORT=$stopPort -DSTOP.KEY=key -jar start.jar 1>serverzk.log 2>&1 &
|
|
|
|
|
2014-08-06 12:46:31 -04:00
|
|
|
cd ..
|
2012-01-25 14:49:26 -05:00
|
|
|
|
2014-12-02 12:41:30 -05:00
|
|
|
cd server
|
2012-01-25 14:49:26 -05:00
|
|
|
|
2014-08-06 12:46:31 -04:00
|
|
|
for (( i=1; i <= $numServers; i++ ))
|
2013-12-22 23:44:26 -05:00
|
|
|
do
|
2014-12-02 12:41:30 -05:00
|
|
|
echo "starting server$i"
|
|
|
|
cd ../server$i
|
2013-12-22 23:44:26 -05:00
|
|
|
stopPort=`expr $baseStopPort + $i`
|
|
|
|
jettyPort=`expr $baseJettyPort + $i`
|
2014-12-02 12:41:30 -05:00
|
|
|
exec -a jetty java -Xmx1g $JAVA_OPTS -Djetty.port=$jettyPort -DzkHost=localhost:9900/$ZK_CHROOT -DSTOP.PORT=$stopPort -DSTOP.KEY=key -jar start.jar 1>server$i.log 2>&1 &
|
2013-12-22 23:44:26 -05:00
|
|
|
done
|