Ian Maxon | d8071ee | 2015-06-24 17:39:05 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Till Westmann | 0f6ee0a | 2015-10-02 17:10:19 -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 |
ramangrover29 | eb8bf05 | 2013-04-02 23:42:56 +0000 | [diff] [blame] | 21 | SERVER_JAVA_HOME=$2 |
| 22 | shift 2 |
ramangrover29@gmail.com | a84a0dc | 2013-03-07 02:59:33 +0000 | [diff] [blame] | 23 | cd $MANAGIX_HOME/.installer/zookeeper |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 24 | tar cf zk.pkg.tar * |
| 25 | zk_server_id=1 |
| 26 | for zk_host in $@ |
| 27 | do |
ramangrover29@gmail.com | a84a0dc | 2013-03-07 02:59:33 +0000 | [diff] [blame] | 28 | ssh $zk_host "mkdir -p $ZK_HOME" |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 29 | 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" |
ramangrover29 | eb8bf05 | 2013-04-02 23:42:56 +0000 | [diff] [blame] | 31 | ssh $zk_host "$ZK_HOME/bin/start_zk.sh $ZK_HOME $zk_server_id $SERVER_JAVA_HOME" & |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 32 | zk_server_id=`expr $zk_server_id + 1` |
| 33 | done |