User data to install and run Docker in an Ubuntu AWS instance

by Marc Cortada 21/05/2017

This snippet is based in Ubuntu 16.04.2 version.

After running this script docker will be installed in your Amazon Web Services instance.

Some attention points:

  • These commands are executed in background when the instance is running and could take some time to finish. If you login just when the instance is available the installation could be not ready yet.
#!/bin/bash

apt-get -y install \
  apt-transport-https \
  ca-certificates \
  curl

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

add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"

apt-get update

apt-get -y install docker-ce
When the machine is running and the execution is finished you can run:
docker run hello-world
This snippet is based in the info available here: https://store.docker.com/editions/community/docker-ce-server-ubuntu

Tags:

Categorías: Amazon Web Services (AWS) | AWS User Data | Developing and programming | Docker

Installing Cassandra in RHEL 7.3 in AWS based instance

by Marc Cortada 20/05/2017

This snippet installs Cassandra in the image Red Hat Enterprise Linux 7.3 available in Amazon Web Services.

To make sure that this deployment will work you should create an instance with minimum of 8GB of memory. This is because the minimum requirements of JVM to enable an efficient garbage collection.

Some attention points:

  • After a restart of the server Cassandra won't run as a service.
  • Is recommended to use instances with more memory, specially for production servers.
  • These commands are executed in background when the instance is running and could take some time to finish. If you login just when the instance is available the installation could be not ready yet.

More...

Tags:

Categorías: Amazon Web Services (AWS) | AWS User Data | BBDD | BigData | Cassandra

Entradas por mes