blob: 8ef6f5fb362b0c0a7376d9804c4929e93958535f [file] [log] [blame]
ramangrover29116eb972013-02-20 20:47:35 +00001ZK_HOME=$1
ramangrover29eb8bf052013-04-02 23:42:56 +00002SERVER_JAVA_HOME=$2
3shift 2
ramangrover29@gmail.coma84a0dc2013-03-07 02:59:33 +00004cd $MANAGIX_HOME/.installer/zookeeper
ramangrover29116eb972013-02-20 20:47:35 +00005tar cf zk.pkg.tar *
6zk_server_id=1
7for zk_host in $@
8do
ramangrover29@gmail.coma84a0dc2013-03-07 02:59:33 +00009 ssh $zk_host "mkdir -p $ZK_HOME"
ramangrover29116eb972013-02-20 20:47:35 +000010 scp ./zk.pkg.tar $zk_host:$ZK_HOME/
11 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 +000012 ssh $zk_host "$ZK_HOME/bin/start_zk.sh $ZK_HOME $zk_server_id $SERVER_JAVA_HOME" &
ramangrover29116eb972013-02-20 20:47:35 +000013 zk_server_id=`expr $zk_server_id + 1`
14done