-
Notifications
You must be signed in to change notification settings - Fork 13
Docker on AWS
- (cloud formation template) Set ec2-user as the user for starting the docker containers. This eliminates the sudo -i command (which is easy to forget)
- (cloud formation template) Add /usr/local/bin to the path.
The CHORDS Docker image can easily be run on AWS. Instructions follow for manually starting a CHORDS server on EC2, as well as an automated procedure using CloudFormation.
Use EC2 to create a bare-bones Linux, using their standard suggested Linux AMI.
ssh into the image, then:
sudo -i
yum update -y
yum install -y docker
service start docker
curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod a+x /usr/local/bin/docker-compose
curl -L https://github.com/NCAR/chords_portal/raw/development/docker-compose.yml > docker-compose.yml
/usr/local/bin/docker-compose pull
/usr/local/bin/docker-compose -p chords up -d
docker ps -a
docker volume ls
We have a CloudFormation template now, in bin/docker.template (and also on Amazon S3). It is much simpler than the original CloudFormationtemplate. Be sure to specify an ssh key, and to set rollback to false. The create timeout is a more comfortable 10m.
With this stack running, you can update CHORDS on the AWS instance by:
ssh -i <key> <EC2 instance ip>
sudo -i
/usr/local/bin/docker-compose pull
/usr/local/bin/docker-compose -p chords down
/usr/local/bin/docker-compose -p chords up -d
We will come up with some hooks for backing up the database from the mysql volume.
- Select the standard AWS ssh key. When creating the stack, specify a reasonably short creation timeout on the configuration screen.
- Turn off "rollback on failure". If creation fails. the instance will be left running. You will be able to ssh and look at logs, try running the commands by hand, etc.
- It's very helpful to look at /var/log/cfn-init-cmd.log. There you can examine the creation commands (and output) that were derived from the template.
I found that io wait went through the roof and the site became unresponsive, when running on a t2.micro. I tried a t2.small, and the problem disappeared. It seems like mysql was running out of ram for it's database access. I found a nice writeup on this issue.
- A very detailed tutorial about running docker on AWS. It touches on several AWS services, including EC2, ECS and ELB.
Project Management
- Stakeholders
- Communication
- Use Cases
- Requirements
- Deliverables
- Milestones Associated with a Release
- "Sandbox" Milestones
- Github Workflow
AWS
- AWS Portal Migrations
- Amazon Appliance Workflow
- Overview
- Bringing up a new CHORDS Portal
- Cloud Formation
- EC2 Costing and Memory Constraints
Docker
- Running CHORDS
- Docker on AWS
- Duplicating Docker/Influxdb portals
- Docker on Raspberry Pi
- Docker Details and Tips
- Running CHORDS on Windows 10
Influxdb
Data Formats
Google Maps
Ingest Utilities
Miscellaneous
- Recovery from a full disk
- Github/Dockerhub release scheme
- CHORDS gh-pages and jeykll
- Bootstrap
- CHORDS Portal Web Site
- Dashboard Helper Refactor
- Development Notes
- Heroku
- Meteobridge
- Migrating from mysql to mysql/influxdb portals
- NCAR Wx Stations into CHORDS
- PAWS to CHORDS
- Post Get Query Syntax
- Postgres Testing
- Rails Tips
- Ruby and Rails Resources
- CUAHSI Archive
Historical Archive