Ian Maxon | d8071ee | 2015-06-24 17:39:05 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Ian Maxon | 928bbd1 | 2015-09-14 17:12:48 -0700 | [diff] [blame] | 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | |
Ian Maxon | d8071ee | 2015-06-24 17:39:05 -0700 | [diff] [blame] | 19 | |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 20 | ZK_HOME=$1 |
| 21 | ZK_ID=$2 |
ramangrover29 | eb8bf05 | 2013-04-02 23:42:56 +0000 | [diff] [blame] | 22 | JAVA_HOME=$3 |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 23 | mkdir $ZK_HOME/data |
| 24 | echo $2 > $ZK_HOME/data/myid |
ramangrover29@gmail.com | 4ba2152 | 2013-02-27 23:35:42 +0000 | [diff] [blame] | 25 | CLASSPATH=$ZK_HOME/lib/zookeeper-3.4.5.jar:$ZK_HOME/lib/log4j-1.2.15.jar:$ZK_HOME/lib/slf4j-api-1.6.1.jar:$ZK_HOME/conf:$ZK_HOME/conf/log4j.properties |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 26 | ZK_CONF=$ZK_HOME/zk.cfg |
| 27 | export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8400,server=y,suspend=n" |
ramangrover29 | eb8bf05 | 2013-04-02 23:42:56 +0000 | [diff] [blame] | 28 | $JAVA_HOME/bin/java $JAVA_OPTS -Dlog4j.configuration="file:$ZK_HOME/conf/log4j.properties" -cp $CLASSPATH org.apache.zookeeper.server.quorum.QuorumPeerMain $ZK_CONF |