Trial Server - Infrastructure

Overview

This is a work in Progress.  The purpose of this document will be to document the Trial server architecture, the processes associated with updates, monitoring and maintenance and specifications of attached services and interdependencies with other network resources.

Infrastructure

Description

  • VPC for isolating infrastructure 
  • Route 53 for DNS resolution
  • NAT Bastion for ssh access/ VPN
  • NAT Bastion for  Reverse Proxy
  • EC2 instance (Web Server)
  • RDS for Database Server (MySQL)
InstanceRAMCore
NAT11
Web Server304
RDS82


Enterprise Trial Maintenance Process

Objective

  •  Take a backup of expired work spaces
  • Copy this backups to AWS Glacier.
  • Delete the expired backups
  • Monitor disk and memory usage through AWS Cloud Watch

Problem

Enterprise Trail has approximately about 3000 work spaces created, this makes the server run out of space very quickly, with out a adequate maintenance and clean up strategy the server could have performance and availability issues.

Solution

  • Script to take a backup of work spaces with more then 45 days of creation.
  • After the backups is taken delete this expired work spaces (files and database)
  • Script to move this backups to AWS Glacier
  • Configure AWS scripts for monitoring Disk and memory metrics through Cloud Watch.

Strategy

  • remove_expired_work spaces script will run every day at midnight to analyze and find expired work spaces
  • Take a backup of the expired work spaces
  • Delete work spaces

Monitoring Memory and Disk Metrics 

These monitoring scripts are intended for use with Amazon EC2 instances running Linux.

To install the required packages


Required Packages
sudo yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https


To download, install, and configure the monitoring scripts

Installation
curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O


Run the following commands to install the monitoring scripts you downloaded:

Installation
unzip CloudWatchMonitoringScripts-1.2.1.zip
rm CloudWatchMonitoringScripts-1.2.1.zip
cd aws-scripts-mon
cp awscreds.template awscreds.conf
AWSAccessKeyId=my-access-key-id
AWSSecretKey=my-secret-access-key


To perform a simple test run without posting data to CloudWatch

Perform simple test
./mon-put-instance-data.pl --mem-util --verify --verbose

To collect all available memory and disk metrics and send them to CloudWatch

Send metrics to cloud watch
/home/devops/aws-scripts-mon/mon-put-instance-data.pl --mem-used-incl-cache-buff --mem-util --mem-used --mem-avail --disk-space-util --disk-path=/ --disk-path=/home --disk-path=/opt --from-cron


To configure cron  service

Cron jobs
*/5 * * * * /home/devops/aws-scripts-mon/mon-put-instance-data.pl --mem-used-incl-cache-buff --mem-util --mem-used --mem-avail --disk-space-util --disk-path=/ --disk-path=/home --disk-path=/opt --from-cron


DashBoard