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

User data to install IIS in Amazon Web Services (AWS) instance

by Marc Cortada 27/11/2015

This script installs IIS in an AWS EC2 Windows Server instance. When the server is up and running an IIS is available to publish content.

Just add the following lines into the text box located at the section "Advanced Details > user data" when you are configuring a new EC2 instance.More...

Tags:

Categorías: Amazon Web Services (AWS) | ASP.NET | AWS User Data | IIS

User data to install and run MongoDB in Amazon Web Services (AWS) instance

by Marc Cortada 26/11/2015

This script installs MongoDB in an AWS EC2 Ubuntu instance, reboots the newly created server and when is up and running an empty MongoDB server is available (to know why the machine must be rebooted go to the end of this post).

Just add the following lines into the text box located at the section "Advanced Details > user data" when you are configuring a new EC2 instance. Remember that the selected AMI type in the previous steps must be an Ubuntu Server.More...

Tags:

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

User data to install and run ElasticSearch in Amazon Web Services (AWS) instance

by Marc Cortada 24/11/2015

This script installs ElasticSearch 1.7 in an AWS EC2 Ubuntu instance and also starts the service. So, Elastic Search is up and running when the machine is available.

Just add the following lines into the text box located at the section "Advanced Details > user data" when you are configuring a new EC2 instance. Remember that the selected AMI type in the previous steps must be an Ubuntu Server.More...

Tags:

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

Recreate logins after restore a database from a backup of another server

by Marc Cortada 01/02/2015

When a database is restored from another server usually contains the user's names that has some privileges for work with this database. But the user's internal keys could be different between these two servers or the user's logins could not exists in the destination server. So, when an user signs in, the privileges to this database has no effect in the final server or returns a login error when tries to sign in.

There is a script that generates and output consisting in an another script that recreates -or transfers- those logins in the destination server. This stored procedure (called sp_help_revlogin) is usually pre-built in your server. If not exists you can create it running the script that could be found at Microsoft's support here. Also, if you want you can run the entire script that you'll find at the end of this post. This script creates the stored procedure sp_help_revlogin in master database (see the use command at the begining of the script).

Once sp_help_revlogin is available in your database, go to the recently restored database (change use <mynewDatabase> in the following example) and execute the procedure called sp_help_revlogin as detailed below. More...

Tags:

Categorías: SQLServer | How to | SQLServer DBA

First post!

by Marc Cortada 14/01/2015

Hi everyone,

This is my first post of this blog in English. Like the analogous in Spanish I will try to share some knowledge. Some posts may be translated from the original Spanish blog, I'll try to translate the most interesting or visited. All comments and critics - also language corrections - are welcome!

I hope that you find useful, I'll try to do it!

Tags:

Categorías:

Entradas por mes