Cloud Computing mit mathematischen Anwendungen Vorlesung SoSe 2009 Dr. Marcel Kunze Karlsruhe Institute of Technology (KIT) Steinbuch Centre for Computing (SCC) KIT the cooperation of Forschungszentrum Karlsruhe GmbH und Universität Karlsruhe (TH) www.kit.edu 04.08
Agenda Cloud Computing 1. Einleitung Was ist Cloud Computing? 2. Grundlagen Virtualisierung, Web Services, Java, 3. Cloud Architekturen Infrastruktur, Plattform, Anwendung 4. Cloud Services Amazon Web Services, Google App Engine 5. Aufbau einer Cloud OpenCirrus Projekt, Eucalyptus 6. Cloud Algorithmen MapReduce, Optimierungsverfahren, Praktische Übungen und Anwendungen Vorlesung im Web: http://www.mathematik.uni-karlsruhe.de/mitglieder/lehre/cloud2009s/ 2
Amazon Web Services http://aws.amazon.com/ 3
Amazon Elastic Compute Cloud (EC2) Infrastructure Cost $ Large Capital Expenditur e You just lost customers Predicted Demand Traditional Hardware Actual Demand Automated Virtualization 4 time
EC2 Sizing Small Large Extra Large Bits 32 64 64 RAM 1.7 GB 7.5 GB 15 GB Disk 160 GB 850 GB 1690 GB EC2 Compute Units 1 4 8 I/O Performance Medium High High Preis (US) $0.10 per hour $0.40 per hour $0.80 per hour 5
Amazon Simple Storage Service (S3) On January 2, 2007, Blue Origin posted information and videos on its web site about a test launch for a new vertical take-off, vertical-landing vehicle. Within the next day, the news was covered by both SlashDot and Boing Boing, sending a tremendous amount of traffic to its web site. With its media files stored in Amazon S3, it was able to instantly scale and handle the 3.5 million requests and 758 GBs in bandwidth in a single day. Blue Origin s total charge for Amazon S3 in January? Just over $300. 6
Amazon Web Services (EC2 und S3) Regionale Aufteilung (Zurzeit us-east, eu-west) Availability Zones (Z.B. Datenspiegelung für Verfügbarkeit) 7
Amazon Machine Images (AMI) Virtuelle Maschinen werden als Amazon Machine Image (AMI) in einem File gespeichert Public AMIs: Verwendung vorkonfigurierter Template-AMIs zur sofortigen Verwendung. Auswahl von Fedora, Ubuntu, OpenSolaris, Windows, Private AMIs: Herstellung eines eigenen AMI mit eigenen Applikationen, Bibliotheken, Daten und Konfiguration Paid AMIs: Festsetzen eines Preises für das eigene AMI. Lasse es andere nutzen und bezahlen (Single payment and/or per hour) Bundling: Herstellen des AMI-Files eines Betriebssystem 8
Bundling von Betriebssystemen AMIs liegen immer im S3-Speicher Beispiel: Bundling eines Linux-Systems 1. Installation der ec2-ami-tools (z.b. yum install ec2-ami-tools) 2. ec2-bundle-vol -d /mnt -k /mnt/pk.pem -c /mnt/cert.pem -u AwsAccountID -r i386 -p meinami 3. ec2-upload-bundle -b vorlesung-us/ami -m /mnt/ meinami.manifest.xml - a accesskey -s secureaccesskey 4. ec2-register vorlesung-us/ami/meinami.manifest.xml Private AMI: Das AMI kann dann privat verwendet werden Public AMI: Das AMI kann publiziert werden durch ec2-modify-image-attribute <ami_id> --launch-permission -a all 9
Paid AMIs Bezahlte Nutzung eines eigenen AMIs Amazon zieht die Gebühren ein und überweist den Überschuss Amazon Flexible Payment System (FPS) / DevPay Flexibel per Stunde Fixkosten monatlich Einmalzahlung Paid AMI wird erzeugt durch Zuordnung eines Produkt-Codes ec2-modify-image-attribute <ami_id> --product-code <product_code> Produkt-Codes werden bei Amazon DevPay beantragt 10
Amazon Simple Storage Service (S3) Hoch skalierbarer Cloud Speicher Programmierbar über Web-Service API Einfach aufzusetzen, einfach zu nutzen Hoch verfügbar Pay-as-you-go: Storage: $0.15 / GB / month Data Transfer: $0.18 / GB Transfer kostenfrei innerhalb der Cloud 11
Entwicklung der S3 Nutzung Gespeicherte Objekte 10 Billion 5 Billion 800 Million August 06 April 07 October 07 14 Billion January 08 12
Amazon S3 Namespace Amazon S3 bucket bucket object object object object bucket object object Buckets speichern beliebig viele Objekte (bis zu 5GB/Objekt) 13
Amazon S3 Namespace Amazon S3 mculver-images media.mydomain.com Beach.jpg 2005/party/hat.jpg img1.jpg img2.jpg public.blueorigin.com index.html img/pic1.jpg Ordner werden durch die Namen der Web-Objekte impliziert Domain-Zugriff durch Amazon CNAME-Eintrag im DNS-Server 14
Internet Backup on a Stick Or Stick Backed Up on the Net? 15
Amanda Open Source Backup 16
Hanzo: Web-Archiv Speichert die Entwicklung von Web-Domains auf S3 (>300 TB) 17
Wie man mit Buckets arbeitet Buckets werden über URL Syntax angesprochen http:<bucket_name>.s3.amazonaws.com/<object_name> Anzeigen eines Objekts im Browser http://vorlesung-us.s3.amazonaws.com/aufgaben/aufgaben.pdf Kopieren eines Objekts über Kommandozeile wget http://vorlesung-us.s3.amazonaws.com/aufgaben/j4b.java Kopieren eines Objekts mit BitTorrent (http://www.bittorrent.com) Preiswerte Verteilung großer Datenmengen an viele Klienten Es fallen nur die Kosten des primären Kopiervorgangs an Das Konfigurationsfile erhält man durch Anhängen von?torrent an einen GET request http://vorlesungus.s3.amazonaws.com/aufgaben/aufgaben.pdf?torrent 18
BitTorrent Hierachisches verteiltes Filesystem Eigener Rechner wird zum Fileserver 19
S3 Management mit S3Fox Organizer FireFox Plugin runterladen von http://www.s3fox.net/ 20
Zugriffskontrolle und Datenschutz Zugriff wird geregelt über Access Control List (ACL) 21
Amazon Simple Queue Service (SQS) Eine verteilte Warteschlange in der Cloud zur Konstruktion verteilter, skalierbarer Systeme Speichert Nachrichten zur Kommunikation zwischen Computern Zuverlässig Läuft in Amazon's high-availability data center Nachrichten werden redundant gespeichert zwischen Servern und Lokationen Beim Auslesen werden Nachrichten nicht gelöscht, sondern ausgeblendet. Sie werden wieder eingeblendet falls eine Transaktion nicht erfolgreich ist (Z.B. keine Response des Servers nach 30s). Skalierbar bis zu Millionen von Nachrichten pro Tag Einfach: Nur 6 Methoden Plattformunabhängig Zugriffskontrolle und Message Locking FIFO = First In First Out 22
23
24
25
26
27
28
29
30
Amazon SimpleDB Einfach: Keine Administration Web Service API Flexibel (Kein Schema, sondern individuelle Attribute) Skalierbar: Anlegen von neuen Domänen im Fall von Datenwachstum Erhöhter Abfragefrequenz Zuverlässig Multiple nodes Replicated data centers Nicht kompatibel zu SQL! 31
Amazon SimpleDB: Beispiel item description color material 123 Sweater Blue, Red 456 Dress shirt White, Blue 789 Shoes Black Leather PUT (item, 123), (description, Sweater), (color, Blue), (color, Red) PUT (item, 456), (description, Dress shirt), (color, White), (color, Blue) PUT (item, 789), (description, Shoes), (color, Black), (material, Leather) Query Domain = MyStore [ description = Sweater ] 32
Amazon Public Datasets Amazon offeriert Wissenschaftlern freien Speicherplatz zur Veröffentlichung von Daten (http://aws.amazon.com/publicdatasets/) Annotated Human Genome Data provided by ENSEMBL The Ensembl project produces genome databases for human as well as almost 50 other species, and makes this information freely available. Various US Census Databases from The US Census Bureau United States demographic data from the 1980, 1990, and 2000 US Censuses, summary information about Business and Industry, and 2003-2006 Economic Household Profile Data. UniGene provided by the National Center for Biotechnology Information A set of transcript sequences of well-characterized genes and hundreds of thousands of expressed sequence tags (EST) that provide an organized view of the transcriptome. Freebase Data Dump from Freebase.com A data dump of all the current facts and assertions in the Freebase system. Freebase is an open database of the world s information, covering millions of topics in hundreds of categories. Drawing from large open data sets like Wikipedia, MusicBrainz, and the SEC archives, it contains structured information on many popular topics, including movies, music, people and locations all reconciled and freely available. 33
Amazon in Education Amazon unterstützt Universitäten (http://aws.amazon.com/education/) 1. Teaching Grants for educators using AWS in courses (plus access to selected course content resources) 2. Research Grants for academic researchers using AWS in their work 3. Project Grants for student organizations pursuing entrepreneurial endeavors; Tutorials for students that want to use AWS for self-directed learning 4. Solutions for university administrators looking to use cloud computing to be more efficient and cost-effective in the university s IT Infrastructure 34
Zusammenfassung Amazon Web Services (AWS) Elastic Compute Cloud (EC2) Simple Storage Service (S3) Simple Queue Service (SQS) Simple Database Service (SimpleDB) Management S3Fox Organizer Firefox Plugin für S3 ElasticFox Firefox Plugin für EC2 35
Karlsruhe Institute of Technology Steinbuch Centre for Computing (SCC) Thank you for your attention. 36