Add RedHat Host Support
This commit is contained in:
49
install-redhat.sh
Normal file
49
install-redhat.sh
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright (c) 2018-2018
|
||||||
|
# Data Intensive Applications and Systems Labaratory (DIAS)
|
||||||
|
# Ecole Polytechnique Federale de Lausanne
|
||||||
|
#
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify and distribute this software and its
|
||||||
|
# documentation is hereby granted, provided that both the copyright notice
|
||||||
|
# and this permission notice appear in all copies of the software, derivative
|
||||||
|
# works or modified versions, and any portions thereof, and that both notices
|
||||||
|
# appear in supporting documentation.
|
||||||
|
#
|
||||||
|
# This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||||
|
# A PARTICULAR PURPOSE. THE AUTHORS AND ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE
|
||||||
|
# DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||||
|
# USE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
# Import settings
|
||||||
|
. ./settings.sh
|
||||||
|
|
||||||
|
# Following official instructions from:
|
||||||
|
# https://docs.docker.com/install/linux/docker-ce/centos/
|
||||||
|
|
||||||
|
# Install docker, for CentOS/RHEL
|
||||||
|
sudo yum install -y yum-utils \
|
||||||
|
device-mapper-persistent-data \
|
||||||
|
lvm2
|
||||||
|
|
||||||
|
sudo yum-config-manager \
|
||||||
|
--add-repo \
|
||||||
|
https://download.docker.com/linux/centos/docker-ce.repo
|
||||||
|
|
||||||
|
# You might be requested to accept the key:
|
||||||
|
echo <<EOT
|
||||||
|
Docker Repository correct key is:
|
||||||
|
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
|
||||||
|
|
||||||
|
If prompted, check the key is correct and accept it.
|
||||||
|
EOT
|
||||||
|
|
||||||
|
sudo yum install docker-ce
|
||||||
|
|
||||||
|
sudo systemctl start docker
|
||||||
|
|
||||||
|
# Install docker-compose
|
||||||
|
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||||
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
# Import settings
|
# Import settings
|
||||||
. ./settings.sh
|
. ./settings.sh
|
||||||
|
|
||||||
|
# Following official instructions from:
|
||||||
|
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
|
||||||
|
|
||||||
# Install docker, for ubuntu
|
# Install docker, for ubuntu
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install \
|
sudo apt install \
|
||||||
@@ -38,28 +41,3 @@ sudo apt install docker-ce
|
|||||||
# Install docker-compose
|
# Install docker-compose
|
||||||
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||||
sudo chmod +x /usr/local/bin/docker-compose
|
sudo chmod +x /usr/local/bin/docker-compose
|
||||||
|
|
||||||
# If requested, setup portainer:
|
|
||||||
if ${PORTAINER_ENABLED}
|
|
||||||
then
|
|
||||||
# Permanent storage for Portainer
|
|
||||||
mkdir -p ${PORTAINER_DATA}
|
|
||||||
|
|
||||||
sudo docker run -d -p ${PORTAINER_PORT}:9000 \
|
|
||||||
--restart unless-stopped \
|
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock:rw \
|
|
||||||
-v ${PORTAINER_DATA}:/data:rw \
|
|
||||||
--name ${COMPOSE_PROJECT_NAME}_${PORTAINER_HOST} \
|
|
||||||
${PORTAINER_IMAGE}${PORTAINER_VERSION}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Permanent storage for the Databases
|
|
||||||
mkdir -p ${DB_DATA}
|
|
||||||
mkdir -p ${DB_DATASETS}
|
|
||||||
sudo chown -R 999:999 ${DB_DATA} ${DB_DATASETS}
|
|
||||||
|
|
||||||
# Permanent storage for Mesos
|
|
||||||
mkdir -p ${MESOS_MASTER_LOGS}
|
|
||||||
mkdir -p ${MESOS_MASTER_TMP}
|
|
||||||
mkdir -p ${MESOS_SLAVE_LOGS}
|
|
||||||
mkdir -p ${MESOS_SLAVE_TMP}
|
|
||||||
19
load_data.sh
19
load_data.sh
@@ -20,6 +20,9 @@
|
|||||||
# Import settings
|
# Import settings
|
||||||
. ./settings.sh
|
. ./settings.sh
|
||||||
|
|
||||||
|
# 1. Create all the DB at once
|
||||||
|
echo "Create databases..."
|
||||||
|
|
||||||
created_network=false
|
created_network=false
|
||||||
if ! docker network ls | grep -q ${MIP_PRIVATE_NETWORK}
|
if ! docker network ls | grep -q ${MIP_PRIVATE_NETWORK}
|
||||||
then
|
then
|
||||||
@@ -27,13 +30,14 @@ then
|
|||||||
created_network=true
|
created_network=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 1. Create all the DB at once
|
for d in ${DB_DATA} ${DB_DATASETS}
|
||||||
echo "Create databases..."
|
do
|
||||||
if [ ! -d ${DB_DATA} ]
|
if [ ! -d ${d} ]
|
||||||
then
|
then
|
||||||
mkdir -p ${DB_DATA}
|
mkdir -p ${d}
|
||||||
sudo chown -R 999:999 ${DB_DATA}
|
sudo chown -R 999:999 ${d}
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
db_id=$(docker run --rm -d \
|
db_id=$(docker run --rm -d \
|
||||||
-e POSTGRES_USER="${DB_USER_ADMIN}" \
|
-e POSTGRES_USER="${DB_USER_ADMIN}" \
|
||||||
@@ -56,6 +60,7 @@ do
|
|||||||
db_list="$db_list $t"
|
db_list="$db_list $t"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Make sure Postgres has initialized, should be a while on pgready or something.
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
|
|||||||
33
portainer.sh
Executable file
33
portainer.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright (c) 2018-2018
|
||||||
|
# Data Intensive Applications and Systems Labaratory (DIAS)
|
||||||
|
# Ecole Polytechnique Federale de Lausanne
|
||||||
|
#
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify and distribute this software and its
|
||||||
|
# documentation is hereby granted, provided that both the copyright notice
|
||||||
|
# and this permission notice appear in all copies of the software, derivative
|
||||||
|
# works or modified versions, and any portions thereof, and that both notices
|
||||||
|
# appear in supporting documentation.
|
||||||
|
#
|
||||||
|
# This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||||
|
# A PARTICULAR PURPOSE. THE AUTHORS AND ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE
|
||||||
|
# DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
|
||||||
|
# USE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
# Import settings
|
||||||
|
. ./settings.sh
|
||||||
|
|
||||||
|
# Permanent storage for Portainer
|
||||||
|
test -d ${PORTAINER_DATA} \
|
||||||
|
|| mkdir -p ${PORTAINER_DATA} \
|
||||||
|
|| ( echo Failed to create ${PORTAINER_DATA}; exit 1 )
|
||||||
|
|
||||||
|
sudo docker run -d -p ${PORTAINER_PORT}:9000 \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-v /var/run/docker.sock:/var/run/docker.sock:rw \
|
||||||
|
-v ${PORTAINER_DATA}:/data:rw \
|
||||||
|
--name ${COMPOSE_PROJECT_NAME}_${PORTAINER_HOST} \
|
||||||
|
${PORTAINER_IMAGE}${PORTAINER_VERSION}
|
||||||
7
run.sh
7
run.sh
@@ -20,6 +20,13 @@
|
|||||||
# Import settings
|
# Import settings
|
||||||
. ./settings.sh
|
. ./settings.sh
|
||||||
|
|
||||||
|
# Permanent storage for Mesos
|
||||||
|
mkdir -p ${MESOS_MASTER_LOGS}
|
||||||
|
mkdir -p ${MESOS_MASTER_TMP}
|
||||||
|
mkdir -p ${MESOS_SLAVE_LOGS}
|
||||||
|
mkdir -p ${MESOS_SLAVE_TMP}
|
||||||
|
|
||||||
|
# Generate Configuration from templates
|
||||||
for f in ${WOKEN_CONF} ${WOKEN_VALIDATION_CONF}
|
for f in ${WOKEN_CONF} ${WOKEN_VALIDATION_CONF}
|
||||||
do
|
do
|
||||||
for v in $(grep '^:' settings.default.sh|cut -c 5- |cut -d: -f1)
|
for v in $(grep '^:' settings.default.sh|cut -c 5- |cut -d: -f1)
|
||||||
|
|||||||
@@ -82,7 +82,6 @@
|
|||||||
: ${PORTAINER_HOST:="portainer"}
|
: ${PORTAINER_HOST:="portainer"}
|
||||||
: ${PORTAINER_PORT:="9000"}
|
: ${PORTAINER_PORT:="9000"}
|
||||||
: ${PORTAINER_DATA:="${PWD}/portainer"}
|
: ${PORTAINER_DATA:="${PWD}/portainer"}
|
||||||
: ${PORTAINER_ENABLED:="true"}
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
# Services
|
# Services
|
||||||
|
|||||||
Reference in New Issue
Block a user