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
|
|
|
|
2015-04-29 10:59:33 -04:00
|
|
|
# Useful if you want to startup on an existing setup with new code mods
|
|
|
|
# ant server dist
|
|
|
|
|
2014-12-02 12:41:30 -05:00
|
|
|
cd serverzk
|
2014-08-06 12:46:31 -04:00
|
|
|
stopPort=1313
|
|
|
|
jettyPort=8900
|
2015-04-28 10:32:55 -04:00
|
|
|
exec -a jettyzk java -Xmx512m $JAVA_OPTS -Djetty.port=$jettyPort -DhostPort=$jettyPort -DzkRun -DzkHost=localhost:9900/$ZK_CHROOT -DzkRunOnly=true -jar start.jar --module=http STOP.PORT=$stopPort STOP.KEY=key jetty.base=. 1>serverzk.log 2>&1 &
|
2014-12-02 12:41:30 -05:00
|
|
|
|
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`
|
2015-04-28 10:32:55 -04:00
|
|
|
exec -a jetty java -Xmx1g $JAVA_OPTS -Djetty.port=$jettyPort -DzkHost=localhost:9900/$ZK_CHROOT -jar start.jar --module=http STOP.PORT=$stopPort STOP.KEY=key jetty.base=. 1>server$i.log 2>&1 &
|
2013-12-22 23:44:26 -05:00
|
|
|
done
|