coreos on google compute engine (and how to scale wordpress in 5 minutes)
DESCRIPTION
How to use CoreOS on GCE to run and easily scale wordpress on docker in 5 minutes. The Google presentation version looks better so check it out here http://goo.gl/FvQwPTTRANSCRIPT
CoreOS on Google Compute Engine
and how to scale Wordpress in 5 minutes.
@patcito
Patrick Aljord
Google Compute Engine (GCE)“Google Compute Engine is a service that provides virtual machines that run on Google infrastructure. Google Compute Engine offers scale, performance, and value that allows you to easily launch large compute clusters on Google's infrastructure. There are no upfront investments and you can run up to thousands of virtual CPUs on a system that has been designed from the ground up to be fast, and to offer strong consistency of performance.”
@patcito
GCE vs AWS1. Pricing & sub-hour billing2. Load Balancer needs no pre-warming3. Persistent Disks that can be connected to multiple VMs4. Better Block Storage (10TB which is 10 times , include i/o pricing no more guessing)
5. Integrated networking (vpn, public subnets, firewalls, routes, gateway, ACL, part of gce unlike VPC)
6. Better network throughput (AWS uses public Internet for communicating between the
regions . GCE much faster, uses google infrastructure).7. Multi-Region images (all images are global unlike aws, which needs explicit)
8. Persistent IP addresses (no need to reassociate after each stop/start of VM)
9. Faster boot times & auto restart of VMs (5X faster than Amazon EC2, 30 seconds for first login)
10. Live migration (graceful live migration of VMs from one host to another making it transparent)@patcito
Why CoreOS?
● Minimal: Linux kernel + systemd● Simple: Package manager is Docker● Secure: Auto-updates & read-only fs● Clustered: Distributed automatically and fails
over seamlessly thanks to etcd and systemd.● Never gonna give you up
@patcito
tl;dr: CoreOS is cool
You get a stable host dedicated to running docker instances, and nothing else.
It’s never gonna:● give you up● let you down● run around and desert you
@patcito
WTF is etcd?
open-source HTTP distributed key value store
sure, but why??so that your apps can use it to store:● database connection details● cache settings● feature flags● and more
@patcito
Cool etcd features
● Simple, curl-able API (HTTP + JSON)● Optional SSL client cert authentication● Benchmarked 1000s of writes/s per instance● Properly distributed using Raft protocol● Keys support TTL● Atomic test and set● Easily listen for changes to a prefix via HTTP
long-polling●
@patcito
● curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash● create a project on https://cloud.google.com/console/project and configure billing● Login: gcloud auth login --no-launch-browser● get CoreOS instance: gcutil --project=<project-id> addimage --description="CoreOS
176.0.0" coreos-production-v176-0-0 gs://storage.core-os.net/coreos/amd64-generic/176.0.0/coreos_production_gce.tar.gz
● Open http ports: gcutil addfirewall httpss --description="Incoming http and https allowed." --allowed="tcp:443,80"
● Create a new instance: gcutil --project=big-lore-459 addinstance docker-paris-meetup4 --image=coreos-production-v176-0-0 --persistent_boot_disk
● ssh to the box: gcutil --project=big-lore-459 ssh --ssh_user=core docker-paris-meetup4
● install wordpress: docker run -d -p 0.0.0.0:80:80 -p 22 jbfink/wordpress● Enjoy!
Test etcd:● test etcd: curl -L http://127.0.0.1:4001/v1/keys/message -d value="Hello world"● curl -L http://127.0.0.1:4001/v1/keys/message
@patcito
http://blog.ricodigo.comhttp://twitter.com/patcito
https://github.com/patcitohttps://plus.google.com/+PatrickAljord
Thank you!