| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- EN-Revision: 24249 -->
- <!-- Reviewed: no -->
- <sect1 id="zend.service.amazon.ec2.instance">
- <title>Zend_Service_Amazon_Ec2: Instanzen</title>
- <sect2 id="zend.service.amazon.ec2.instance.types">
- <title>Instanz Typen</title>
- <para>
- Amazon EC2 Instanzen werden in zwei Familien gruppiert: Standard und High-CPU. Standard
- Instanzen haben Speicher und <acronym>CPU</acronym> Ratio die für die meisten generell
- gedachten Anwendungen passen; High-CPU Instanzen haben proportional mehr
- <acronym>CPU</acronym> Ressourcen als Speicher (RAM) und sind gedacht für
- rechen-intensive Anwendungen. Wenn Instanz-Typen ausgewählt werden, kann es gewünscht
- sein wenig intensive Instanztypen für Web-Server Instanzen zu verwenden und intensivere
- Instanz-Typen für eigene Datenbank-Instanzen. Zusätzlich kann es gewünscht sein
- <acronym>CPU</acronym> Instanztypen für <acronym>CPU</acronym>-intensive
- Datenverarbeitungs Tasks zu verwenden.
- </para>
- <para>
- Eine der Vorteile von EC2 ist das man pro Stunde der Instanz zahlt, was es bequem und
- kostengünstig macht die Performance der eigenen Anwendung auf verschiedenen
- Instanzfamilien und Typen zu testen. Ein guter Weg um zu erkennen welches die
- passenste Instanzfamilie und der passenste Instanztyp ist, besteht darin Testinstanzen
- zu starten und die Anweundung zu benchmarken.
- </para>
- <note>
- <title>Instanz Typen</title>
- <para>
- Der Instanztyp ist als Konstante im Code definiert. Spalte acht in der Tabelle ist
- der definierte Name der Konstante
- </para>
- </note>
- <table id="zend.service.amazon.ec2.instance.types-table">
- <title>Vorhandene Instanztypen</title>
- <tgroup cols="8">
- <thead>
- <row>
- <entry>Typ</entry>
- <entry><acronym>CPU</acronym></entry>
- <entry>Hauptspeicher</entry>
- <entry>Plattenspeicher</entry>
- <entry>Plattform</entry>
- <entry>I/O</entry>
- <entry>Name</entry>
- <entry>Name der Konstante</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>Klein</code></entry>
- <entry>
- <para>
- 1 <constant>EC2</constant> Recheneinheit (1 virtueller Kern mit 1
- <constant>EC2</constant> Recheneinheit)
- </para>
- </entry>
- <entry><para>1.7 GB</para></entry>
- <entry>
- <para>
- 160 GB Speicher der Instanz (150 GB plus 10 GB Root Partition)
- </para>
- </entry>
- <entry><para>32-bit</para></entry>
- <entry><para>Moderat</para></entry>
- <entry><para>m1.small</para></entry>
- <entry><constant>Zend_Service_Amazon_Ec2_Instance::SMALL</constant></entry>
- </row>
- <row>
- <entry><code>Groß</code></entry>
- <entry>
- <para>
- 4 <constant>EC2</constant> Recheneinheiten (2 virtuelle Kerne mit
- jeweils 2 <constant>EC2</constant> Recheneinheiten)
- </para>
- </entry>
- <entry><para>7.5 GB</para></entry>
- <entry>
- <para>
- 850 GB Speicher der Instanz (2 x 420 GB plus 10 GB Root Partition)
- </para>
- </entry>
- <entry><para>64-bit</para></entry>
- <entry><para>Hoch</para></entry>
- <entry><para>m1.large</para></entry>
- <entry><constant>Zend_Service_Amazon_Ec2_Instance::LARGE</constant></entry>
- </row>
- <row>
- <entry><code>Extra Groß</code></entry>
- <entry>
- <para>
- 8 <constant>EC2</constant> Recheneinheiten (4 virtuelle Kerne mit
- jeweils 2 <constant>EC2</constant> Recheneinheiten)
- </para>
- </entry>
- <entry><para>15 GB</para></entry>
- <entry>
- <para>
- 1,690 GB Speicher der Instanz (4 x 420 GB plus 10 GB Root Partition)
- </para>
- </entry>
- <entry><para>64-bit</para></entry>
- <entry><para>Hoch</para></entry>
- <entry><para>m1.xlarge</para></entry>
- <entry><constant>Zend_Service_Amazon_Ec2_Instance::XLARGE</constant></entry>
- </row>
- <row>
- <entry><code>High-CPU Medium</code></entry>
- <entry>
- <para>
- 5 <constant>EC2</constant> Recheneinheiten (2 virtuelle Kerne mit
- jeweils 2.5 <constant>EC2</constant> Recheneinheiten)
- </para>
- </entry>
- <entry><para>1.7 GB</para></entry>
- <entry>
- <para>
- 350 GB Speicher der Instanz (340 GB plus 10 GB Root Partition)
- </para>
- </entry>
- <entry><para>32-bit</para></entry>
- <entry><para>Durchschnittlich</para></entry>
- <entry><para>c1.medium</para></entry>
- <entry>
- <constant>Zend_Service_Amazon_Ec2_Instance::HCPU_MEDIUM</constant>
- </entry>
- </row>
- <row>
- <entry><code>High-CPU Extra Groß</code></entry>
- <entry>
- <para>
- 20 <constant>EC2</constant> Recheneinheiten (8 virtuelle Kerne mit
- jeweils 2.5 <constant>EC2</constant> Recheneinheiten)
- </para>
- </entry>
- <entry><para>7 GB</para></entry>
- <entry>
- <para>
- 1,690 GB Speicher der Instanz (4 x 420 GB plus 10 GB Root Partition)
- </para>
- </entry>
- <entry><para>64-bit</para></entry>
- <entry><para>Hoch</para></entry>
- <entry><para>c1.xlarge</para></entry>
- <entry>
- <constant>Zend_Service_Amazon_Ec2_Instance::HCPU_XLARGE</constant>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.service.amazon.ec2.instance.operations">
- <title>Ausführen von Amazon EC2 Instanzen</title>
- <para>
- Dieses Kapitel beschreibt die Methoden für die Behandlung von Amazon EC2 Instanzen.
- </para>
- <example id="zend.service.amazon.ec2.instance.operations.run">
- <title>Starten neuer EC2 Instanzen</title>
- <para>
- <code>run</code> startetn eine spezifische Anzahl von EC2 Instanzen.
- <code>run</code> nimmt für den Start ein Array von Parametern. Anbei ist eine
- Tabelle welche die gültigen Werte enthält.
- </para>
- <para>
- <table id="zend.service.amazon.ec2.instance.operations.run-table">
- <title>Gültige Optionen für das Starten</title>
- <tgroup cols="3">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Beschreibung</entry>
- <entry>Benötigt</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>imageId</code></entry>
- <entry>
- <para>
- ID der <acronym>AMI</acronym> mit der Instanzen gestartet
- werden.
- </para>
- </entry>
- <entry><para>Ja</para></entry>
- </row>
- <row>
- <entry><code>minCount</code></entry>
- <entry>
- <para>
- Minimale Anzahl der zu startenden Instanzen. Standardwert: 1
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>maxCount</code></entry>
- <entry>
- <para>
- Maximale Anzahl der zu startenden Instanzen. Standardwert: 1
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>keyName</code></entry>
- <entry>
- <para>
- Name des Schlüsselpaares mit dem Instanzen gestartet werden.
- Wenn man keinen Schlüssel angibt, werden alle Instanzen
- unangreifbar.
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>securityGroup</code></entry>
- <entry>
- <para>
- Name der Sicherheitsgruppe mit der Instanzen zu assoziieren
- sind.
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>userData</code></entry>
- <entry>
- <para>
- Die Benutzerdaten welche bei den zu startenden Instanzen
- vorhanden sind. Diese sollten nicht Base64 verschlüsselt
- sein.
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>instanceType</code></entry>
- <entry>
- <para>
- Spezifiziert den Instanztyp. Standardwert: m1.small
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>placement</code></entry>
- <entry>
- <para>
- Spezifiziert die Availability Zone in der Instanz(en) zu
- starten sind. Standardmäßig wählt Amazon
- <constant>EC2</constant> eine Availability Zone aus.
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>kernelId</code></entry>
- <entry>
- <para>
- Die ID des Kernels mit dem die Instanz gestartet werden
- soll.
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>ramdiskId</code></entry>
- <entry>
- <para>
- Die ID der <acronym>RAM</acronym> Disk mit der die Instanz
- gestartet werden soll.
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>blockDeviceVirtualName</code></entry>
- <entry>
- <para>
- Spezifiziert den virtuellen Name der zu dem
- korrespondierenden Devicenamen gemappt werden soll. Zum
- Beispiel: instancestore0
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>blockDeviceName</code></entry>
- <entry>
- <para>
- Spezifiziert das Device zu dem der virtuelle Name gemappt
- werden soll. Zum Beispiel: sdb
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- <row>
- <entry><code>monitor</code></entry>
- <entry>
- <para>
- Schaltet das Monitoring für die <acronym>AWS</acronym>
- CloudWatch Instanz ein
- </para>
- </entry>
- <entry><para>Nein</para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </para>
- <para>
- <code>run</code> gibt Informationen über jede Instanz zurück die gestartet wird.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->run(array('imageId' => 'ami-509320',
- 'keyName' => 'myKey',
- 'securityGroup' => array('web',
- 'default')));
- ]]></programlisting>
- </example>
- <example id="zend.service.amazon.ec2.instance.operations.reboot">
- <title>Neu booten von EC2 Instanzen</title>
- <para>
- <code>reboot</code> bootet eine oder mehrere Instanzen.
- </para>
- <para>
- Diese Operation ist asynchron; die queuet nur die Anfrage eine spezifizierte
- Instanz(en) zu rebooten. Die Operation wird erfolgreich sein wenn die Instanzen
- gültig sind und dem Benutzer gehören. Anfragen um beendete Instanzen zu rebooten
- werden ignoriert.
- </para>
- <para>
- <code>reboot</code> gibt ein boolsches <constant>TRUE</constant> oder
- <constant>FALSE</constant> zurück
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->reboot('instanceId');
- ]]></programlisting>
- </example>
- <example id="zend.service.amazon.ec2.instance.operations.terminate">
- <title>Beenden von EC2 Instanzen</title>
- <para>
- <code>terminate</code> führt eine oder mehrere Instanzen herunter. Diese Operation
- ist idempotent; wenn eine Instanz mehr als einmal terminiert wird, wird jeder
- Aufruf erfolgreich sein.
- </para>
- <para>
- <code>terminate</code> gibt ein boolsches <constant>TRUE</constant> oder
- <constant>FALSE</constant> zurück
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->terminate('instanceId');
- ]]></programlisting>
- </example>
- <note>
- <title>Terminierte Instanzen</title>
- <para>Terminierte Instanzen bleiben nach der Terminierung sichtbar (voraussichtlich
- eine Stunde).</para>
- </note>
- </sect2>
- <sect2 id="zend.service.amazon.ec2.instance.utility">
- <title>Utilities für Amazon Instanzen</title>
- <para>
- In diesem Kapitel erfährt man wie man Informationen über die Ausgabe der Console
- erhält und sieht ob eine Instanz einen Produktcode enthält.
- </para>
- <example id="zend.service.amazon.ec2.instance.utility.describe">
- <title>Instanzen beschreiben</title>
- <para>
- <code>describe</code> gibt Information über die Instanzen zurück die einem
- gehören.
- </para>
- <para>
- Wenn man eine oder mehrere Instanz IDs spezifiziert, gibt Amazon EC2 Informationen
- über diese Instanzen zurück. Wenn man keine Instanz IDs spezifiziert, gibt Amazon
- EC2 Informationen über alle relevanten Instanzen zurück. Wenn eine ungültige
- Instanz ID spezifiziert wird, wird ein Fehler zurückgegeben. Wenn eine Instanz
- spezifiziert wird die man nicht besitzt, wird diese in den zurückgegebenen
- Ergebnissen nicht enthalten sein.
- </para>
- <para>
- <code>describe</code> gibt ein Array zurück das Informationen über die Instanz
- enthält.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->describe('instanceId');
- ]]></programlisting>
- </example>
- <note>
- <title>Beendete Instanzen</title>
- <para>
- Kürzlich beendete Instanzen können in den zurückgegebenen Ergebnissen
- vorkommen. Das Interval ist normalerweise weniger als eine Stunde. Wenn man
- nicht will das beendete Instanzen zurückgegeben werden, muß eine zweite
- Variable, ein boolsches <constant>TRUE</constant>, an <code>describe</code>
- übergeben werden, und die beendete Instanz wird ignoriert.
- </para>
- </note>
- <example id="zend.service.amazon.ec2.instance.utility.describebyimageid">
- <title>Instanzen anhand der Image Id beschreiben</title>
- <para>
- <code>describeByImageId</code> ist funktional identisch mit <code>describe</code>
- gibt aber nur die Instanz zurück, welche die angegebene imageId verwendet.
- </para>
- <para>
- <code>describeByImageId</code> gibt ein Array zurück das Informationen über die
- Instanzen enthält, die von der übergebenen imageId gestartet wurden.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->describeByImageId('imageId');
- ]]></programlisting>
- </example>
- <note>
- <title>Beendete Instanzen</title>
- <para>
- Kürzlich beendete Instanzen können in den zurückgegebenen Ergebnissen
- vorkommen. Das Interval ist normalerweise weniger als eine Stunde. Wenn man
- nicht will das beendete Instanzen zurückgegeben werden, muß eine zweite
- Variable, ein boolsches <constant>TRUE</constant>, an <code>describe</code>
- übergeben werden, und die beendete Instanz wird ignoriert.
- </para>
- </note>
- <example id="zend.service.amazon.ec2.instance.utility.consoleOutput">
- <title>Empfangen von Konsolen-Ausgaben</title>
- <para>
- <code>consoleOutput</code> empfänge die Ausgabe der Konsole für eine spezifizierte
- Instanz.
- </para>
- <para>
- Die Ausgabe der Konsole einer Instanz wird gepuffert und kurz nach dem Booten, neu
- Booten, und Beenden der Instanz gesendet. Amazon EC2 sichert die letzten 64 KB
- Ausgabe, welche zumindest eine Stunde nach dem letzten Senden verfügbar sein ist.
- </para>
- <para>
- <code>consoleOutput</code> gibt ein Array zurück das
- <code>instanceId</code>, <code>timestamp</code> von der letzten Ausgabe enthält und
- <code>output</code> von der Konsole.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->consoleOutput('instanceId');
- ]]></programlisting>
- </example>
- <example id="zend.service.amazon.ec2.instance.utility.confirmproduct">
- <title>Produktcode an einer Instanz bestätigen</title>
- <para>
- <code>confirmProduct</code> gibt <constant>TRUE</constant> zurück wenn der
- spezifizierte Produktcode der spezifizierten Instanz angehängt ist. Die Operation
- gibt <constant>FALSE</constant> zurück wenn der Produktcode der Instanz nicht
- angehängt ist.
- </para>
- <para>
- Die <code>confirmProduct</code> Operation kann nur von dem Eigentümer der
- <acronym>AMI</acronym> ausgeführt werden. Dieses Feature ist nützlich wenn ein
- <acronym>AMI</acronym> Eigentümer Support anbietet und sicherstellen will ob die
- Instanz eines Benutzer korrekt ist.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->confirmProduct('productCode', 'instanceId');
- ]]></programlisting>
- </example>
- <example id="zend.service.amazon.ec2.instance.utility.monitor">
- <title>Einschalten des CloudWatch Monitorings für Instanzen</title>
- <para>
- <code>monitor</code> gibt die Liste von Instanzn und deren aktuellen Status vom
- CloudWatch Monitorings zurück. Wenn die Instant das Monitoring aktuell nicht
- aktiviert hat, dann wird es eingeschaltet.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->monitor('instanceId');
- ]]></programlisting>
- </example>
- <example id="zend.service.amazon.ec2.instance.utility.unmonitor">
- <title>Ausschalten des CloudWatch Monitorings für Instanzen</title>
- <para>
- <code>monitor</code> gibt die Liste von Instanzn und deren aktuellen Status vom
- CloudWatch Monitorings zurück. Wenn die Instant das Monitoring aktuell aktiviert
- hat, dann wird es ausgeschaltet.
- </para>
- <programlisting language="php"><![CDATA[
- $ec2_instance = new Zend_Service_Amazon_Ec2_Instance('aws_key',
- 'aws_secret_key');
- $return = $ec2_instance->unmonitor('instanceId');
- ]]></programlisting>
- </example>
- </sect2>
- </sect1>
|