blob: 946abeb51b6a446b4e4c6fefc78dae7e56c8e247 [file] [log] [blame]
Ian Maxond8071ee2015-06-24 17:39:05 -07001#!/usr/bin/env bash
Ian Maxon928bbd12015-09-14 17:12:48 -07002# 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 Maxond8071ee2015-06-24 17:39:05 -070019
ramangrover29116eb972013-02-20 20:47:35 +000020ZK_HOME=$1
21ZK_ID=$2
ramangrover29eb8bf052013-04-02 23:42:56 +000022JAVA_HOME=$3
ramangrover29116eb972013-02-20 20:47:35 +000023mkdir $ZK_HOME/data
24echo $2 > $ZK_HOME/data/myid
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000025CLASSPATH=$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 +000026ZK_CONF=$ZK_HOME/zk.cfg
27export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8400,server=y,suspend=n"
ramangrover29eb8bf052013-04-02 23:42:56 +000028$JAVA_HOME/bin/java $JAVA_OPTS -Dlog4j.configuration="file:$ZK_HOME/conf/log4j.properties" -cp $CLASSPATH org.apache.zookeeper.server.quorum.QuorumPeerMain $ZK_CONF