blob: 86769cd162044ce76b043a711d28b9d84234579b [file] [log] [blame]
Ian Maxond8071ee2015-06-24 17:39:05 -07001#!/usr/bin/env bash
Till Westmannea8ab392013-06-05 15:17:08 -07002#/*
3# Copyright 2009-2013 by The Regents of the University of California
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# you may obtain a copy of the License from
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Ian Maxond8071ee2015-06-24 17:39:05 -070015
ramangrover29116eb972013-02-20 20:47:35 +000016ZK_HOME=$1
17ZK_ID=$2
ramangrover29eb8bf052013-04-02 23:42:56 +000018JAVA_HOME=$3
ramangrover29116eb972013-02-20 20:47:35 +000019mkdir $ZK_HOME/data
20echo $2 > $ZK_HOME/data/myid
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000021CLASSPATH=$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
ramangrover29116eb972013-02-20 20:47:35 +000022ZK_CONF=$ZK_HOME/zk.cfg
23export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8400,server=y,suspend=n"
ramangrover29eb8bf052013-04-02 23:42:56 +000024$JAVA_HOME/bin/java $JAVA_OPTS -Dlog4j.configuration="file:$ZK_HOME/conf/log4j.properties" -cp $CLASSPATH org.apache.zookeeper.server.quorum.QuorumPeerMain $ZK_CONF