|
| 1 | +#!/usr/bin/env bash |
| 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 | + |
| 19 | +if [ "$#" -ne 1 ]; then |
| 20 | + echo "Usage: $0 zookeeper-<version-number>" |
| 21 | + echo "Example:" |
| 22 | + echo "$ $0 zookeeper-3.4.14" |
| 23 | + exit 1 |
| 24 | +fi |
| 25 | + |
| 26 | +ZK_DIST=$1 |
| 27 | + |
| 28 | +curl -O "https://archive.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz" |
| 29 | +tar -xzf ./$ZK_DIST.tar.gz -C /opt |
| 30 | +rm ./$ZK_DIST.tar.gz |
| 31 | + |
| 32 | +mv /opt/$ZK_DIST /opt/zookeeper |
| 33 | +rm -rf /opt/zookeeper/CHANGES.txt \ |
| 34 | + /opt/zookeeper/README.txt \ |
| 35 | + /opt/zookeeper/NOTICE.txt \ |
| 36 | + /opt/zookeeper/CHANGES.txt \ |
| 37 | + /opt/zookeeper/README_packaging.txt \ |
| 38 | + /opt/zookeeper/build.xml \ |
| 39 | + /opt/zookeeper/config \ |
| 40 | + /opt/zookeeper/contrib \ |
| 41 | + /opt/zookeeper/dist-maven \ |
| 42 | + /opt/zookeeper/docs \ |
| 43 | + /opt/zookeeper/ivy.xml \ |
| 44 | + /opt/zookeeper/ivysettings.xml \ |
| 45 | + /opt/zookeeper/recipes \ |
| 46 | + /opt/zookeeper/src \ |
| 47 | + /opt/zookeeper/$ZK_DIST.jar.asc \ |
| 48 | + /opt/zookeeper/$ZK_DIST.jar.md5 \ |
| 49 | + /opt/zookeeper/$ZK_DIST.jar.sha1 |
| 50 | + |
| 51 | +# copy zk scripts |
| 52 | +mkdir -p /opt/zookeeper/scripts |
| 53 | +cp /opt/heron-docker/scripts/generate-zookeeper-config.sh /opt/zookeeper/scripts/ |
| 54 | +chmod +x /opt/heron-docker/scripts/generate-zookeeper-config.sh |
| 55 | +cp /opt/heron-docker/scripts/zookeeper-ruok.sh /opt/zookeeper/scripts/ |
| 56 | +chmod +x /opt/heron-docker/scripts/zookeeper-ruok.sh |
| 57 | +cp /opt/heron-docker/scripts/start-zookeeper.sh /opt/zookeeper/scripts/ |
| 58 | +chmod +x /opt/heron-docker/scripts/ |
| 59 | +cp /opt/heron-docker/scripts/wait-for-zookeeper.sh /opt/zookeeper/scripts/ |
| 60 | +chmod +x /opt/heron-docker/scripts/wait-for-zookeeper.sh |
0 commit comments