-
Notifications
You must be signed in to change notification settings - Fork 24
/
startcat.tmpl
22 lines (20 loc) · 904 Bytes
/
startcat.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#for $sid, $servername, $clientport, $port1, $port2 in $serverlist
ssh $username@$servername <<ENDSSH
cd zookeeper
if [ ! -f ./$servername:$clientport/zookeeper_server.pid ] ; then
SERVER_JVMFLAGS=""
#if $sasl
SERVER_JVMFLAGS="\${SERVER_JVMFLAGS} -Djava.security.auth.login.config=/path/to/server/jaas/file.conf"
#end if
#if $trace
SERVER_JVMFLAGS="\${SERVER_JVMFLAGS} -Dzookeeper.root.logger=TRACE,CONSOLE,TRACEFILE -Dzookeeper.log.dir=./$servername:$clientport"
#end if
java \$ZKCONF_START_ZKOPTS \$SERVER_JVMFLAGS -cp ./*:. org.apache.zookeeper.server.quorum.QuorumPeerMain ./$servername:$clientport/zoo.cfg > ./$servername:$clientport/zoo.log 2>&1 &
echo -n \\$! > ./$servername:$clientport/zookeeper_server.pid
else
PID="\\$(cat ./$servername:$clientport/zookeeper_server.pid)"
echo "Server ./$servername:$clientport already started as PID \\${PID}"
fi
ENDSSH
#end for