Skip to content

Containerisation_setup

Jack edited this page Jun 24, 2020 · 2 revisions

Containerisation of MySQL Database

This document details the containerisation of a Mysql Database both locally and on the SCD Cloud for Monitoring the State of Autoreduction

Locally

SCD Cloud

Download and Install Docker

  • Configure Virtual Machine on SCD Cloud - I would recommend using m3.small flavour of ubuntu Xenial NoGui distribution if just for testing purposes.

  • SSH into machine using <staff_username>@

  • Run sudo apt-get update

  • Install Docker repository using the following command:

    sudo apt-get install \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg-agent \
        software-properties-common
    
  • check if hostname exists in VM:

    cat /etc/hosts

    • If hostname doesn't exist use vim to edit /etc/hosts to add it 127.0.0.1 <hostname>
  • Add Docker official GPG key:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

  • Verify You now have key with fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88:

    sudo apt-key fingerprint 0EBFCD88

  • Setup a stable repository on x86_64/ amd64:

       sudo add-apt-repository \
           "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
           $(lsb_release -cs) \
           stable"
    
  • Update all existing packadge using command: sudo apt update

  • you are about to install from the Docker repo instead of the default Ubuntu repo using command:

    'apt-cache policy docker-ce'

    This should output something along the following lines:

    docker-ce:
      Installed: (none)
      Candidate: 18.03.1~ce~3-0~ubuntu
      Version table:
         18.03.1~ce~3-0~ubuntu 500
            500 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
    
  • Install latest Version of Docker Engine and containerd using command:

    sudo apt-get install docker-ce docker-ce-cli containerd.io

  • Optionally, but also good practice - check everything installed correctly by trying the following commands:

    • docker --version
    • sudo docker run hello-world
    • sudo docker ps -a
    • sudo docker rm <CONTAINER ID>

Clone System monitoring Repository - (Alter this to be a sparse checkout)

Clone repository: git clone https://github.com/ISISSoftwareServices/AutoreductionMonitor.git

Setup Containerised Database

Follow instructions within repository located here (note you will need to add sudo to each command):

  • database_containerisation/README.md - (Please note that when running docker commands on SCD Cloud, you may need to add sudo)

HOME

       Overview

Database

       Database

Containerisation

       Overview

       Installation and Setup

       External Access

       Testing

Architecture

       Architecture

Clone this wiki locally