Módulo 3
http://twitter.com/wcamb/
http://blogs.msdn.com/wcamb/
Azure:
Web Role, Worker Role & VM Role
Cada instância roda na sua própria VM e é
replicada caso necessário
•
Windows Azure service
roles
role
role
modelo de serviço
Web
Role
Worker
Role
VM
Role
endpoints
Roles
− Web Role
hospedada
− Worker Role
executável
− VM Role
VM – Virtual Machine (vhd)
Web /
Worker
Role
Maior Abstração
Admin
Web /
Worker
Role
VM Role
Maior Controle
Internet
L
B
Internet
Windows Azure
WebSite
Site
Web
(ASPX, ASMX,
Web
(ASPX, Site
ASMX,
Queues
Worker
Worker
Worker
Service
Service
Service
WCF)etc.)
(ASPX, WCF)
WCF,
Tables
Storage
L
B
Blobs
−
−
−
−
Nome da Role
Tipo da Role
Tamanho da VM (ex: small, medium, etc.)
Network endpoints
− Web/Worker Role: DLL hospedada e outros executáveis
− VM Role: arquivo VHD
− Quantidade de instâncias
− Quantidade de update e fault domains
Role: MiddleTier
Definition
Type: Worker
VM Size: Large
Endpoints:
Internal-1
Configuration
Instances: 3
Update Domains: 2
Fault Domains: 2
.
Template para
soluções do
Windows Azure
.
.
.
.
.
Roles escolhidos
para a aplicação
Lista de roles
disponíveis para um
projeto no Azure
.
.
.
Definições e
Configuração da
solução Azure
Projeto de
Web Role para a
Interface Web
Projeto de
Worker Role para
processos background
.
.
.
Definindo o número
de instâncias para
cada Azure Role
Definindo o VM Size
para cada Azure Role
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="MeuAzureService"
xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="MeuWebRole">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
</WebRole>
<WorkerRole name="MeuWorkerRole">
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
</WorkerRole>
</ServiceDefinition>
1
4
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="MeuAzureService"
xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration"
osFamily="1" osVersion="*">
<Role name="MeuWebRole">
<Instances count=“2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"
value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
<Role name="MeuWorkerRole">
<Instances count=“3" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"
value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
lab #02
Introdução sobre o Windows Azure Roles
http://twitter.com/wcamb/
http://blogs.msdn.com/wcamb/
Download

Role - Microsoft