cloud provisioning mit juju

Click here to load reader

Post on 07-Aug-2015

62 views

Category:

Internet

0 download

Embed Size (px)

TRANSCRIPT

  1. 1. Cloud Provisioning mit Juju
  2. 2. Frank Mller OldenburgBaujahr [email protected]@themue
  3. 3. Bereitgestellte Infrastruktur ...
  4. 4. ... ist nichts ohne bereitgestellte Dienste
  5. 5. mysql wordpress Bekanntes Szenario auf individuellen Servern
  6. 6. Hhere Komplexitt in Clouds wordpress mediawikihaproxy-w mediawiki memcached haproxy-b wordpress mysql wordpressvarnish
  7. 7. Ein mhsamer Weg
  8. 8. Juju - Open Source Tool zur Automatisierung von Clouds http://jujucharms.com
  9. 9. Plattformen
  10. 10. Plattformen mediawiki wordpress AWS Azure OpenStack Joyent ... haproxy-w mediawiki memcached haproxy-b wordpress mysql wordpressvarnish
  11. 11. juju generate-cong # ~/.juju/environments.yaml # https://jujucharms.com/docs/cong-aws.html amazon: type: ec2 # region: us-east-1 # access-key: # secret-key: # image-stream: "released" ...
  12. 12. juju bootstrap Bootstrap
  13. 13. Bootstrap API State Provisioner ... Zentrale Funktionen
  14. 14. Provisionierung
  15. 15. juju deploy juju-gui juju deploy wordpress juju deploy mysql juju expose juju-gui Bootstrap juju-gui wordpress mysql
  16. 16. Deploy mit Constraints arch (amd64, arm, i386, arm64, ppc64) container (none, lxc, kvm) cpu-cores / cpu-power / mem root-disk instance-type networks / tags (nur fr MaaS)
  17. 17. Relationen
  18. 18. juju add-relation wordpress mysql juju expose wordpress Bootstrap juju-gui wordpress mysql
  19. 19. Konguration
  20. 20. juju set mysql dataset-size=50% juju set wordpress tuning=optimized Bootstrap juju-gui wordpress* mysql*
  21. 21. Skalieren
  22. 22. juju deploy memcached juju add-relation wordpress memcached juju add-unit wordpress wordpress* Bootstrap juju-gui wordpress* mysql* memcached
  23. 23. Varianten
  24. 24. Unit Unit Unter- geordnete Unit Unit Unit Unit Container Direkte Abhngigkeit Standard
  25. 25. Vom Charm zur Unit Individuelle Agenten Machiner / Uniter Zentrale Agenten Provisioner / Firewaller Unit Charm
  26. 26. Komfort als Geschenk
  27. 27. Juju GUI (1)
  28. 28. Juju GUI (2)
  29. 29. Bundles
  30. 30. Status juju status machines: "0": agent-state: started agent-version: 1.12.0 dns-name: 15.185.88.51 instance-id: "1736045" series: precise ... services: wordpress: charm: cs:precise/wordpress-42 exposed: true units: wordpress/0: agent-state: started agent-version: 1.12.0 machine: "1" open-ports: - 80/tcp public-address: 15.185.89.236
  31. 31. Charms
  32. 32. Charm-Bestandteile Bauplan aus statischen und dynamischen Anteilen Metadaten Kongurationsoptionen Unit Hooks install / cong-changed / start upgrade-charm / stop Relation Hooks x-relation-joined / x-relation-changed x-relation-departed / x-relation-broken Actions z.B. pause / snapshot restore / optimize ...
  33. 33. Barebone Charm mit Charm Tools juju charm create vanilla
  34. 34. Charm metadata.yaml name: wordpress summary: WordPress is a ... maintainer: Marco Ceppi description: | This will install and setup WordPress ... categories: ["applications"] requires: db: interface: mysql nfs: interface: mount cache: interface: memcache provides: website: interface: http peers: loadbalancer: interface: reversenginx
  35. 35. Hooks - Wordpress install #!/bin/bash set -xe add-apt-repository ppa:charmers/charm-helpers apt-get update && apt-get -y upgrade apt-get -y install php5-memcache mysql-client pwgenphp5 php5-fpm php-apc mailutils php-mail sysstatphp5-mysql php5-mcrypt charm-helper-sh php5-curlrsync nfs-common git-core mktemp modprobe nfs || true ...
  36. 36. Wichtige Umgebungsvariablen fr Hooks JUJU_HOOK_NAME JUJU_API_ADDRESSES JUJU_ENV_NAME / JUJU_ENV_UUID JUJU_UNIT_NAME JUJU_RELATION / ..._ID JUJU_REMOTE_UNIT
  37. 37. Tools in Hooks juju-log fr Logging juju-reboot fr Reboots, zum Beispiel nach einem Upgrade unit-get zur Abfrage von Adressinformationen cong-get zur Abfrage der Konguration open-port / close-port / opened-ports fr die Verwaltung von Ports relation-set / relation-get / relation-list / relation-ids fr die Verwaltung von Relationen
  38. 38. actions.yaml deniert Actions pause: description: Pause the database. ... resume: description: Resume a paused database. ... snapshot: description: Take a snapshot of the database. params: outle: type: string description: The lename to write to. required: [outle] additionalProperties: false
  39. 39. Tools in Action-Skripten action-get um Parameter abzufragen action-set fr Rckgabewerte action-fail zum Signalisieren von Fehlern
  40. 40. Action-Kommandos juju action dened mysql juju action do mysql/0 snapshot lename=out.tar.gz juju action fetch juju action status
  41. 41. Einige Charms ceph mediawiki mongodb cassandra rails mysql wordpress rabbitmq haproxy apache2 hadoop squid hbase couchdb postgresql nfs ntp
  42. 42. Viel Spa in den Wolken
  43. 43. Bildquellen 123RFiStockphotoeigene Quellen