blob: e15f3d53175dcc769fd771a7d3b05614e783aadc [file] [log] [blame]
Ian Maxond8071ee2015-06-24 17:39:05 -07001#!/usr/bin/env bash
Till Westmann0f6ee0a2015-10-02 17:10:19 -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
ramangrover29eb8bf052013-04-02 23:42:56 +000021SERVER_JAVA_HOME=$2
22shift 2
ramangrover29@gmail.coma84a0dc2013-03-07 02:59:33 +000023cd $MANAGIX_HOME/.installer/zookeeper
ramangrover29116eb972013-02-20 20:47:35 +000024tar cf zk.pkg.tar *
25zk_server_id=1
26for zk_host in $@
27do
ramangrover29@gmail.coma84a0dc2013-03-07 02:59:33 +000028 ssh $zk_host "mkdir -p $ZK_HOME"
ramangrover29116eb972013-02-20 20:47:35 +000029 scp ./zk.pkg.tar $zk_host:$ZK_HOME/
30 ssh $zk_host "cd $ZK_HOME && tar xf $ZK_HOME/zk.pkg.tar && chmod +x $ZK_HOME/bin/start_zk.sh"
ramangrover29eb8bf052013-04-02 23:42:56 +000031 ssh $zk_host "$ZK_HOME/bin/start_zk.sh $ZK_HOME $zk_server_id $SERVER_JAVA_HOME" &
ramangrover29116eb972013-02-20 20:47:35 +000032 zk_server_id=`expr $zk_server_id + 1`
33done