2017-11-08 22:56:31 -05:00
|
|
|
#!/bin/bash
|
2018-09-18 11:39:26 -04:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2017-11-08 22:56:31 -05:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2021-03-11 12:07:51 -05:00
|
|
|
APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST:-https://archive.apache.org}
|
2017-11-08 22:56:31 -05:00
|
|
|
|
|
|
|
apt-get update
|
|
|
|
|
|
|
|
# wget
|
|
|
|
apt-get install -y wget
|
|
|
|
|
|
|
|
# MySQL (Metadata store)
|
2021-01-31 11:35:39 -05:00
|
|
|
apt-get install -y default-mysql-server
|
2017-11-08 22:56:31 -05:00
|
|
|
|
|
|
|
# Supervisor
|
|
|
|
apt-get install -y supervisor
|
|
|
|
|
|
|
|
# Zookeeper
|
2020-05-27 16:20:32 -04:00
|
|
|
|
2021-01-31 11:35:39 -05:00
|
|
|
install_zk() {
|
2021-03-11 12:07:51 -05:00
|
|
|
wget -q -O /tmp/$ZK_TAR.tar.gz "$APACHE_ARCHIVE_MIRROR_HOST/dist/zookeeper/zookeeper-$ZK_VERSION/$ZK_TAR.tar.gz"
|
2021-01-31 11:35:39 -05:00
|
|
|
tar -xzf /tmp/$ZK_TAR.tar.gz -C /usr/local
|
|
|
|
cp /usr/local/$ZK_TAR/conf/zoo_sample.cfg /usr/local/$ZK_TAR/conf/zoo.cfg
|
|
|
|
rm /tmp/$ZK_TAR.tar.gz
|
|
|
|
}
|
2020-05-27 16:20:32 -04:00
|
|
|
|
2021-01-31 11:35:39 -05:00
|
|
|
ZK_TAR=apache-zookeeper-$ZK_VERSION-bin
|
|
|
|
install_zk
|
2021-05-25 15:49:49 -04:00
|
|
|
ln -s /usr/local/$ZK_TAR /usr/local/zookeeper
|
2017-11-08 22:56:31 -05:00
|
|
|
|
|
|
|
# Kafka
|
2021-04-24 11:27:07 -04:00
|
|
|
# KAFKA_VERSION is defined by docker build arguments
|
2021-03-11 12:07:51 -05:00
|
|
|
wget -q -O /tmp/kafka_2.13-$KAFKA_VERSION.tgz "$APACHE_ARCHIVE_MIRROR_HOST/dist/kafka/$KAFKA_VERSION/kafka_2.13-$KAFKA_VERSION.tgz"
|
2020-08-15 10:56:40 -04:00
|
|
|
tar -xzf /tmp/kafka_2.13-$KAFKA_VERSION.tgz -C /usr/local
|
|
|
|
ln -s /usr/local/kafka_2.13-$KAFKA_VERSION /usr/local/kafka
|
|
|
|
rm /tmp/kafka_2.13-$KAFKA_VERSION.tgz
|
2017-11-08 22:56:31 -05:00
|
|
|
|
|
|
|
# Druid system user
|
|
|
|
adduser --system --group --no-create-home druid \
|
|
|
|
&& mkdir -p /var/lib/druid \
|
|
|
|
&& chown druid:druid /var/lib/druid
|
|
|
|
|
|
|
|
# clean up time
|
|
|
|
apt-get clean \
|
|
|
|
&& rm -rf /tmp/* \
|
|
|
|
/var/tmp/* \
|
|
|
|
/var/lib/apt/lists \
|
|
|
|
/root/.m2
|