Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CoreOS on Google Compute Engine (and how to sca...

CoreOS on Google Compute Engine (and how to scale Wordpress in 5 minutes).

How to use CoreOS on GCE to run and easily scale wordpress on docker in 5 minutes. The Google presentation version looks better with working links so check it out here http://goo.gl/FvQwPT

Avatar for Patrick Aljord

Patrick Aljord

January 14, 2014

Other Decks in Programming

Transcript

  1. CoreOS on Google Compute Engine and how to scale Wordpress

    in 5 minutes. @patcito Patrick Aljord for @DockerParis meetup http://www.meetup.com/Docker-Paris
  2. 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
  3. GCE vs AWS 1. Pricing & sub-hour billing 2. Load

    Balancer needs no pre-warming 3. Persistent Disks that can be connected to multiple VMs 4. 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
  4. 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. @patcito
  5. 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
  6. 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
  7. 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
  8. • 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: • 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