Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

43
Formation Introduction

Transcript of Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Page 1: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Formation

Introduction

Page 2: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Introduction Amazon Web Services

Formation AWS Introduction

2

Page 3: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Plan• Contexte• Panorama des services AWS• Présentation de la console web• Zoom sur EC2 et S3• Gestion des coûts

Formation AWS Introduction

3

Page 4: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Contexte

Formation AWS Introduction

4

Page 5: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Il était une fois ...• 1995 : le premier site

marchand majeur « amazon.com »

• 1996 : 15.7 M$ de CA dès sa première année fiscale

• Environ 0.5 % du volume de vente de Wal-Mart

• Système monolithique• Difficulté pour passer à

l'échelle

Formation AWS Introduction

5

Page 6: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Du site marchand à la plateforme• 2002 : une API pour gérer la plateforme Amazon (AWS)• 2004 : sous l'impulsion de Werner Vogel, AWS devient une

plateforme cloud.• Découpage d'AWS selon une Architecture Orienté Services

(SOA)

Formation AWS Introduction

6

haikel
Si AWS est devenu un service, c'est principalement du fait qu'en dehors des période de fortes demandes (comme Noël), de nombreuses ressources restent inutilisées
Page 7: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

AWS : Quelques chiffres• 8 régions (+ 1 région spéciale)

• Amérique du nord : 3 + 1 dédié au gouvernement US• Amérique du sud (Sao Paulo)• Europe : Irlande• Asie-Pacifique : Tokyo, Singapour, Sidney

• CA : 1.19 milliards € (108 millions bénéfice net)• 22 services accessibles via la console d'administration (et de nouveaux apparaissent régulièrement)

Formation AWS Introduction

7

Page 8: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

AWS : services

Formation AWS Introduction

8

Page 9: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

AWS 101

Formation AWS Introduction

9

Page 10: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Architecture Résiliente• AWS est divisé en 9 régions

cloisonnées• Chaque région comporte des

zones de disponibilités• Toutes les zones de

disponibilités au sein d'une même région sont physiquement distinctes (data centers) mais sont reliées au sein d'un même réseau

Formation AWS Introduction

10

Page 11: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Régions• Amérique du nord

• us-east-1 (Virginie du Nord)• us-west-1 (Oregon)• us-west-2 (Californie du

Nord)• GovCloud (dédié

gouvernement & agences gouvernementales US)

• Europe• us-west-1 (Irlande)

Formation AWS Introduction

• Amérique du sud•  sa-east-1 (Sao Paulo)

• Asie-Pacifique•  ap-northeast-1 (Tokyo)•  ap-southeast-1 (Singapour)•  ap-southeast-2 (Sidney)

11

Page 12: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Vue d'ensemble

Formation AWS Introduction

12

Page 13: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Région eu-west-1

Formation AWS Introduction

13

haikel
Distances entre les différents datacenterseu-west-1a <> eu-west-1b : 47.4kmeu-west-1a <> eu-west-1c : 38.2kmeu-west-1b <> eu-west-1c : 37.6km
Page 14: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Les services de base• EC2 (Elastic Compute Cloud)

• Service de gestion d'instances virtuelles• S3 (Simple Storage Service)

• Service de gestion de stockage• EBS (Elastic Block Store)

• Service de volumes de stockage en mode bloc• ELB (Elastic Load Balancing)

• Service de Load Balancing• Glacier

• Service d'archivage

Formation AWS Introduction

14

Page 15: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 (1)• Instanciation de machines virtuelles

• basé sur l'hyperviseur Xen• Différentes tailles ou « type d'instances »

• CPU, mémoire, espace de stockage, etc.• Utilisation d’images disques (AMI)

• Prédéfinies (market place) ou créées par l’utilisateur • Différents types d'instances (réservées, à la demande, spot)

• Coût !

Formation AWS Introduction

15

Page 16: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 (2)• Provisionnement configurable

• script user-data, Cloud-Init• Pare-feu configurable indépendamment de l'OS

• Security Groups• Attention, par défaut, limitation à 20 instances concurrentes

• limites pouvant être levées par Amazon sur demande• En pratique, il est difficile d'allouer plus de 50 instances d'un coup

Formation AWS Introduction

16

Page 17: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 : zoom sur les instances (1)• AMI (Amazon Machine Image) est un snapshot d'un système qui servira de base pour une instance EC2• Une instance EC2 est une machine virtuelle qui utilise sa propre copie de l'AMI• Une instance possède un identifiant unique commençant par « i-XXXX »• Deux types d'instances :

• Instance storage : stockage non persistent• EBS storage : le système de fichiers racine est hébergé sur un

volume EBS persistent

Formation AWS Introduction

17

Page 18: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 : zoom sur les instances (2)

Formation AWS Introduction

18

CPU Mémoire I/O stockage Application

micro + + + + Charge faible

standard ++ ++ ++ ++ Plupart des applications

high-cpu +++ ++ ++ ++ Tâches CPU intensifs

high-memory ++ +++ ++ ++ Bases de données, caches

high-IO ++ ++ +++ ++ Base NoSQL

high-storage ++ ++ ++ +++ Data warehousing,Systèmes de fichiers distribués (HDFS, MapReduce)

Cluster compute +++ +++ +++ ++ HPC

Cluster GPU +++ +++ +++ ++ GPGPU (nVidia Fermi)

Page 19: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 : instances réservées• Paiement en une seule fois (jusqu'à 71 % d'économie)• Remise sur volume

• -10 % pour 250k$/annuel, -20 % à partir de 20M$/annuel• Garantie d'une capacité de réserve• Passage automatique en paiement à la demande uniquement si le nombre d'instances courantes dépasse le nombre d'instances réservées• Possibilité de « vendre » les instances réservées sur la place de marché

Formation AWS Introduction

19

haikel
Risque de vertical scaling ou surcapacité avec les instances réservés, penser à le signaler
Page 20: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 : instances spot• Ce sont les instances inutilisées d'AWS mise en enchères• Vous placez une enchère, si celle-ci dépasse l'enchère moyenne, vous obtenez une instance• L'instance est arrêtée dès que l'enchère moyenne dépasse votre enchère maximum et que le pool d'instances inutilisées est vide• Pratique pour les applications batchs où l'arrêt « brutal » d'une instance peut-être aisément récupérée

Formation AWS Introduction

20

Page 21: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 : Security Groups• Définit un ensemble de règles de pare-feu• Par défaut, le trafic sortant est non régulé, le trafic entrant

est bloquant (ssh compris)• Toute instance tourne dans un groupe de sécurité (par

défaut : « default »)• Possibilité de créer des groupes de sécurité• Remplace un pare-feu matériel

Formation AWS Introduction

21

Page 22: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

IAM (Identity & Access Management) • Gestion des rôles et des accès• Gestion des groupes d'utilisateurs• Limitations des APIs accessibles en fonction des rôles • Facturation détaillée par rôles/groupes• Définir des politiques d'accès

• Par rôle• Par ressource

Formation AWS Introduction

22

Page 23: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EBS (Elastic Bloc Storage)• Fournit des volumes de stockage persistants• Volumes qui peuvent être attachés/détachés à une ou

plusieurs instances EC2• Possibilité de créer des snapshots d'un volume EBS à un

instant t• Possibilité de créer un nouveau volume à partir d'un snapshot• Les volumes ont un identifiant du type « vol-XXXX »• Les snapshots ont un identifiant du type « snap-XXXX »

Formation AWS Introduction

23

Page 24: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Elastic Load Balancing• Distribution automatique de charge• Gère les protocoles TCP, HTTP(S), SSL• On peut attacher/détacher dynamiquement plusieurs

instances EC2• Possibilité de s'interfacer avec le service d'auto-scaling pour

provisionner/dé-provisionner dynamiquement des instances EC2 en fonction de politiques pré-définies

Formation AWS Introduction

24

Page 25: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

S3• Stockage d'objets (de 1 à 5 To)• Les objets sont associés à une clé unique• Nombre illimité d'objets• Les objets sont stockés dans des buckets (conteneurs)• Les buckets sont assignés à une région• Authentification et ACL• Les objets peuvent être rendu publics ou non• Option « RRS » (redondance réduite) pour réduire les coûts

(possibilité d'être notifié des pertes via SNS)

Formation AWS Introduction

25

Page 26: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Glacier• Coût très faible (0.01$/Go/mois)• Délai de récupération longs• Accessible via S3 (restauration ~ 3 à 5h)

Formation AWS Introduction

26

Page 27: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Route53• DNS-as-a-Service• Gère vos DNS au sein et en dehors d'AWS• Routage basé sur la latence avec gestion de poids• Interfaçage avec les instances EC2, EIP et ELB

Formation AWS Introduction

27

Page 28: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Simple Queueing Service• Système de files de messages distribués et fiable• Permet de découpler les différents éléments de votre architecture• Historiquement, le premier service AWS et le plus fiable• Principes

• Paradigme producteur/consommateur• Files de messages (espace tampon)• Messages limités à 64ko de texte (format libre)• Gestion des ACL• SQS garantit la livraison des messages

Formation AWS Introduction

28

Page 29: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Simple Notification Service• Service de notification accessible aux applications et clients• Pattern publish/subscrib (PubSub)• Principes

• Topic : une file de messages nommées• Modèle push

Formation AWS Introduction

29

SQS SNS

consommateurs Pas d'inscripton Inscription/confirmation obligatoire

multiplicité Habituellement 1-1 Broadcast 1-N

Modèle communication pull push

haikel
Page 30: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Relational Database Service• DBaaS (MySQL 5.x, Oracle, MS SQL Server)• Déploiement d'une infrastructure de base MySQL haute-disponibilité avec réplication, sauvegarde/récupération • Sans effort ou presque !• Possibilité d'importer/exporter vos bases de données

•     Astuces • Préférez l'utilisation du moteur de stockage InnoDB• MyISAM ne permet pas l'utilisation des sauvegardes à chaud

(PITR) !

Formation AWS Introduction

30

Page 31: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

DynamoDB• Première base de données NoSQL d'Amazon (clé/valeur)• Très rapide (latence : qq ms, s'exécute sur SSD)• Réplication sur 3 zones de disponibilité au sein d'une région• Lecture à cohérence forte (compteur atomique)• Hautement scalable

Formation AWS Introduction

31

Page 32: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

SimpleDB• DBaaS non relationnel (NoSQL) orienté document• Pas de clés étrangères, pas de jointures !• Langage de requêtes natif ou via un dialecte SQL• Uses cases : indexation, FTS, stockage configuration etc.

Formation AWS Introduction

32

SimpleDB SQL

Pas de bases Organisés en bases

domaines tables

items enregistrements

colonnes attributs

valeurs valeurs

Page 33: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Elastic Map Reduce• Plateforme Map/Reduce basée sur Hadoop• Gère automagiquement le déploiement de votre cluster• Propose un fonctionnement en job flow• Distribution MapR : M3 (community) et M5 (entreprise)• L'ensemble de la stack est disponible : HDFS, Pig/Latin, Hive• Possibilité de configurer le démarrage de votre plateforme et

récupérer les logs• API : Hadoop Streaming, custom Jar• Intégration à S3

Formation AWS Introduction

33

Page 34: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Virtual Private Cloud• Son propre cloud privé à portée de mains !• Réseau virtuel isolé

• Plage IP propre• sous-réseaux

• Limiter les accès à S3 au VPC• Associer une EIP à une instance au sein du VPC• Accès VPN à votre VPC (coût : 0.05$/h par accès VPN)

Formation AWS Introduction

34

Page 35: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Console Amazon

Formation AWS Introduction

35

haikel
Démonstration live !
Page 36: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Gestion des coûts

Formation AWS Introduction

36

Page 37: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

La calculatrice

• Calculatrice Amazon https://calculator.s3.amazonaws.com/calc5.html

• Gère les services suivants• EC2 (inclut EBS, EIP), S3, RDS, DynamoDB, SimpleDB, SQS,

SES, SNS, SWF, Route53, Glacier, CloudFront, ElasticCache, CloudWatch, VPC, MapReduce, etc.

Formation AWS Introduction

37

Page 38: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Formation AWS Introduction

38

Page 39: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2• L'heure entamée est dûe• Facturation varie en fonction de la taille de l'instance, de la région• Les transferts entrants sont gratuits• La première année : 730h gratuites d'instances t1.micro

• Astuces• Privilégiez les instances réservées• Si possible utilisez les instances spot pour les batchs• Les transferts de données au sein d'une zone de

disponibilités sont gratuits

Formation AWS Introduction

39

Page 40: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

EC2 (2)

• Les EIP sont payantes lorsqu'elles sont inutilisées (soit les libérer, soit les attacher temporairement à une autre instance)• Astuces

• Préférer le vertical scaling pour gérer les montées en charge.• Mettre en œuvre l'auto-scaling

• Ordonnancement en fonction de la date et de l'heure• Politiques d'agrandissement/réduction en fonction des

métriques• Désallouer les volumes EBS non utilisés• Préférer l'utilisation d'ELB que d'allouer une instance pour

faire votre propre équilibrage

Formation AWS Introduction

40

Page 41: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

S3• Première année : 5Go de stockage, 2000 requêtes PUT, 20000 requêtes GET offertes, 15 Go de trafic sortant

• Astuces• Possibilité de réduire les coûts pour les données non

essentielles en activant l'option « redondance réduite »• Pour l'archivage, préférez Glacier

Formation AWS Introduction

41

Page 42: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

AWS Trusted Advisor • Outil d'analyse de votre utilisation de la plate-forme AWS• Inspecte plus de 100 points• Émets des recommandations pour optimiser vos coûts,

améliorer les performances de votre infrastructure et signaler les failles de sécurité

• Accessible à partir d'un plan de support Business

Formation AWS Introduction

42

Page 43: Formation Introduction. Introduction Amazon Web Services Formation AWSIntroduction 2.

Bibliographie

Formation AWS Introduction

43