From 98e52d727271b5eee164e52d9730908f54c91021 Mon Sep 17 00:00:00 2001 From: Simon Crowle <sgc@it-innovation.soton.ac.uk> Date: Wed, 25 Apr 2018 15:23:17 +0100 Subject: [PATCH] Adds instrumented MINIO service Minio Prometheus metrics are extracted using the Telegraf Promethesus plugin. --- clmctest/inputs/rspec.yml | 19 ++++- clmctest/services/minio/install.sh | 84 +++++++++++++++++++++ clmctest/services/minio/minio.conf | 22 ++++++ clmctest/services/minio/telegraf_minio.conf | 23 ++++++ 4 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 clmctest/services/minio/install.sh create mode 100644 clmctest/services/minio/minio.conf create mode 100644 clmctest/services/minio/telegraf_minio.conf diff --git a/clmctest/inputs/rspec.yml b/clmctest/inputs/rspec.yml index c0b62e9..7d90398 100644 --- a/clmctest/inputs/rspec.yml +++ b/clmctest/inputs/rspec.yml @@ -121,4 +121,21 @@ hosts: cpus: 1 memory: 2048 disk: "10GB" - ip_address: "172.40.231.200" \ No newline at end of file + ip_address: "172.40.231.200" + - name: minio + service_name: "minio" + cpus: 1 + memory: 2048 + disk: "10GB" + forward_ports: + - guest: 9000 + host: 9000 + ip_address: "172.40.231.155" + location: "DC1" + sfc_id: "MS_Template_1" + sfc_id_instance: "MS_I1" + sf_id: "adaptive_streaming" + sf_id_instance: "adaptive_streaming_I1" + ipendpoint_id: "adaptive_streaming_I1_minio" + influxdb_url: "http://172.40.231.51:8086" + database_name: "CLMCMetrics" \ No newline at end of file diff --git a/clmctest/services/minio/install.sh b/clmctest/services/minio/install.sh new file mode 100644 index 0000000..5c7ff69 --- /dev/null +++ b/clmctest/services/minio/install.sh @@ -0,0 +1,84 @@ +#!/bin/bash +#///////////////////////////////////////////////////////////////////////// +#// +#// (c) University of Southampton IT Innovation Centre, 2018 +#// +#// Copyright in this software belongs to University of Southampton +#// IT Innovation Centre of Gamma House, Enterprise Road, +#// Chilworth Science Park, Southampton, SO16 7NS, UK. +#// +#// This software may not be used, sold, licensed, transferred, copied +#// or reproduced in whole or in part in any manner or form or in or +#// on any media by any person other than in accordance with the terms +#// of the Licence Agreement supplied with the software, or otherwise +#// without the prior written consent of the copyright owners. +#// +#// This software is distributed WITHOUT ANY WARRANTY, without even the +#// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +#// PURPOSE, except where stated in the Licence Agreement supplied with +#// the software. +#// +#// Created By : Simon Crowle +#// Created Date : 18/04/2018 +#// Created for Project : FLAME +#// +#///////////////////////////////////////////////////////////////////////// + +# Prerequisites +sudo apt-get update +sudo apt-get install -y wget git + +# Environment variables for this process +GOROOT=/usr/local/go +PATH=$PATH:$GOROOT/bin +CGO_ENABLED=0 +ENV MINIO_UPDATE=off + +# And also for separate MINIO process +echo "export GOROOT=/usr/local/go" >> ~/.profile +echo "export PATH=$PATH:$GOROOT/bin" >> ~/.profile +echo "export CGO_ENABLED=0" >> ~/.profile +echo "export ENV MINIO_UPDATE=off" >> ~/.profile + +# Install GO +# ----------------------------------------------------------------------- +cd /tmp +wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz +sudo tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz + +# Install MINIO +# ----------------------------------------------------------------------- +sudo mkdir -p /usr/local/go/src/github.com/minio +cd /usr/local/go/src/github.com/minio +git clone https://github.com/minio/minio + +cd minio +go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" + +# check minio configuration available +MINIO_CONF_SOURCE=$REPO_ROOT"/clmctest/services/minio/minio.conf" +if [ ! -f "$MINIO_CONF_SOURCE" ]; then + echo "Error: MINIO conf file does not exist on in the repo. "$MINIO_CONF_SOURCE + exit 1 +fi + +# configure minio & check +sudo mkdir -p /etc/minio +MINIO_CONF_TARGET="/etc/minio/config.json" +sudo cp -rf $MINIO_CONF_SOURCE $MINIO_CONF_TARGET + +if [ ! -f "$MINIO_CONF_TARGET" ]; then + echo "Error: MINIO conf copy failed to target machine. "$MINIO_CONF_TARGET + exit 1 +fi + +mkdir -p /vagrant/minio_data + +# Start MINIO +# ----------------------------------------------------------------------- +nohup minio server --config-dir /etc/minio /vagrant/minio_data &>/dev/null & +echo Started MINIO + + + + diff --git a/clmctest/services/minio/minio.conf b/clmctest/services/minio/minio.conf new file mode 100644 index 0000000..08a4616 --- /dev/null +++ b/clmctest/services/minio/minio.conf @@ -0,0 +1,22 @@ +{ + "version": "23", + "credential": { + "accessKey": "F2H4IJ5SITH4C85LAVZL", + "secretKey": "RiI7f6b9KMKwo+rSuOkzUa13+2dFA7oMyaTqgF/q" + }, + "region": "", + "browser": "on", + "domain": "", + "storageclass": { + "standard": "", + "rrs": "" + }, + "cache": { + "drives": [], + "expiry": 90, + "exclude": [] + }, + "notify": { + + } +} \ No newline at end of file diff --git a/clmctest/services/minio/telegraf_minio.conf b/clmctest/services/minio/telegraf_minio.conf new file mode 100644 index 0000000..f184957 --- /dev/null +++ b/clmctest/services/minio/telegraf_minio.conf @@ -0,0 +1,23 @@ +## © University of Southampton IT Innovation Centre, 2018 +## +## Copyright in this software belongs to University of Southampton +## IT Innovation Centre of Gamma House, Enterprise Road, +## Chilworth Science Park, Southampton, SO16 7NS, UK. +## +## This software may not be used, sold, licensed, transferred, copied +## or reproduced in whole or in part in any manner or form or in or +## on any media by any person other than in accordance with the terms +## of the Licence Agreement supplied with the software, or otherwise +## without the prior written consent of the copyright owners. +## +## This software is distributed WITHOUT ANY WARRANTY, without even the +## implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +## PURPOSE, except where stated in the Licence Agreement supplied with +## the software. +## +## Created By : Simon Crowle +## Created Date : 18-04-2018 +## Created for Project : FLAME + +[[inputs.prometheus]] + urls = ["http://localhost:9000/minio/prometheus/metrics"] \ No newline at end of file -- GitLab