Ian Maxon | d8071ee | 2015-06-24 17:39:05 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 3 | ZK_HOME=$1 |
ramangrover29 | eb8bf05 | 2013-04-02 23:42:56 +0000 | [diff] [blame] | 4 | SERVER_JAVA_HOME=$2 |
| 5 | shift 2 |
ramangrover29@gmail.com | a84a0dc | 2013-03-07 02:59:33 +0000 | [diff] [blame] | 6 | cd $MANAGIX_HOME/.installer/zookeeper |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 7 | tar cf zk.pkg.tar * |
| 8 | zk_server_id=1 |
| 9 | for zk_host in $@ |
| 10 | do |
ramangrover29@gmail.com | a84a0dc | 2013-03-07 02:59:33 +0000 | [diff] [blame] | 11 | ssh $zk_host "mkdir -p $ZK_HOME" |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 12 | scp ./zk.pkg.tar $zk_host:$ZK_HOME/ |
| 13 | 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] | 14 | 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] | 15 | zk_server_id=`expr $zk_server_id + 1` |
| 16 | done |