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

NodeJS with the Google Cloud

Johann du Toit
July 29, 2014
130

NodeJS with the Google Cloud

Johann du Toit and Hiren Patel, GDE's for Cloud. Demo some features of the Google Cloud and try to show some demo's of running NodeJS on Compute with Replica Clusters and Templates

Johann du Toit

July 29, 2014
Tweet

Transcript

  1. Agenda 1. Intro to Google Cloud Platform 2. Installing /

    Using GCloud utils 3. Demo using a Simple NodeJS Service 4. Doing bit more heavier processing with Compute 5. Q&A 6. Social + Snacks/Drinks
  2. • Run virtual machines in the cloud (not just any

    cloud though) • Choose a machine type to suit your application needs • variety of OS images to choose from, or a custom one • live migration and disruption free maintenance • persistent storage, encrypted before stored to media • API access • competitive pricing (following Moore's law)
  3. • Create/select a project at cloud.google.com/console • Enable billing for

    the project • Go to APIs, enable google compute engine • Create or note your project id (required later)
  4. • gcloud - manage google cloud platform resources • gcutil

    - cli tool for GCE ➔ gcloud auth login ➔ gcutil getproject --project=<project-id> -- cache_flag_values
  5. ➔ gcutil listmachinetypes • standard, high memory, high cpu, shared

    core ➔ gcutil --project=<project-id> addinstance <instance- name> --machine_type=n1-standard-1 • Instances run in regions/zones ➔ gcutil listregions ➔ gcutil listzones
  6. • images - OS/root filesystem • public (google, vendors, etc),

    or project private ➔ gcutil listimages • can be created from root persistent disks (gcimagebundle, gcutil addimage) • images can be created from scratch - advanced usage (see the docs)
  7. • Disks - persistent, network based storage • standard or

    ssd disks • lifecycle separate to that of instances ➔ gcutil listdisks/getdisks ➔ gcutil adddisk/attachdisk/detachdisk/deletedisk ➔ gcutil push/pull • IOPS performance increases with disk size • throughput grows to max of VM limit • under the hood, data is striped across many disks • modeled for predictable performance
  8. ➔ gcutil addinstance my-first-instance --machine_type=f1- micro --image=debian-7 --zone=us-central1-a -- wait_until_running

    --auto_delete_boot_disk ➔ gcutil listinstances ➔ gcutil getinstance my-first-instance ➔ gcutil push my-first-instance testfile /home/hiren/ ➔ gcutil ssh my-first-instance ➔ gcutil listdisks ➔ gcutil deleteinstance my-first-instance
  9. • Default network, allow ssh, allow internal • Max 2

    IPs, internal, and optional external • Traffic through external IP is billed • External IPs are static or ephemeral ➔ gcutil listaddresses • up to 5 networks, IPv4 • max egress cap of 2Gbits/second per cpu core ➔ gcutil listfirewalls/addfirewall/deletefirewall ➔ gcutil addfirewall http2 --description="Incoming http allowed." --allowed="tcp:http"
  10. • https://cloud.google.com/products/calculator/ • Instances billed for 10 mins, then by

    the minute • Sustained use discounts • Persistent disks billed by GB, not IOPS. Bill does not vary on usage fluctuations of a disk • Details at https://developers.google. com/compute/pricing
  11. Node.JS & Compute Give us 5 min to swap around

    the command centre ... by Johann