Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Cloud Computing AWS
Multiservidores
Para Problemas Complexos,
Soluções Simples!
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Sérgio Antônio Pohlmann .'.

sergio@ycube.net
sergio.pohlmann@gmail.com

Patrocinio /Apoio:
Integra Software Solutions
Universidad Autonoma de Encarnación
Cloud fisl 12_pohlmann
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Amazon Web Services
EC2 Elastic Computing Cloud
● S3
Simple Storage Service
● EBS Elastic Block Storage
● ELB
Elastic Load Balancing
● Amazon CloudWatch
●
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Como começar com AWS (grátis)

Criar uma conta em AWS

●

http://aws.amazon.com
Criar uma instancia para provas

●

Escolher uma ferramenta para trabalhar

●
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Ferramentas para AWS

Ferramenta de Administração AWS

●

AWS API

●

ElasticFox

●
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Ferramenta de Administração AWS

●
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Lançando uma instância
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Diferenças de instâncias

EC2

●

EBS

●
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Comunity AMIs
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Usando Elasticfox
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Problemas 'Existenciais'
Consistencia de dados

●

?

Consistencia de IP

●

Reconfiguração

●

EBS
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Exemplo
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
/root
..

.bashrc
.autoconfig

export HOST_=zabbix
export INFORM_IP=50.126.14.231

preparedata
informConfig
cpConfig
autoConfigure
lib
functions

export IP_=`ifconfig| grep "255.255" |
cut -d' ' -f 12 | cut -d: -f 2`
# Throw configuration controls
/root/.autoconfig/prepareData
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
/root
Parte 1

.bashrc
.autoconfig
preparedata
informConfig
cpConfig
autoConfigure
lib
functions

PATH="/root/.autoconfig";
MAILSERVER="/usr/sbin/ssmtp";
MSGFILE="$PATH/.changeIP.msg";
MAILTO="sergio@ycube.net";
# Prepare a file to inform a instance IP
echo "<?php $url="
http://$INFORM_IP/404/writeConfig.php?".
"host=$HOST_&ip=$IP_"; ?>" > .temp
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
/root
.bashrc
.autoconfig
preparedata

# Check a IP Change
if [ -e $PATH/.old_ip ] then
. $PATH/.old_ip
fi

Parte 2

if [ "$IP_" != "$OLD_IP" ] then
# Prepare a message to send
echo "To: $MAILTO " > $MSGFILE;
echo "Subject: $HOST_ IP Changed"
>> $MSGFILE
echo "$HOST_ has changed your IP"
>> $MSGFILE
echo
>> $MSGFILE
echo "New IP is: $IP_" >> $MSGFILE

informConfig
cpConfig
autoConfigure
lib
functions
fi

$MAILSERVER $MAILTO < $MSGFILE
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
/root
Parte 3

.bashrc
.autoconfig

echo "OLD_IP=$IP_" > $PATH/.old_ip

preparedata

# Inform a the instance name and IP

informConfig

$PATH/informConfig

cpConfig
autoConfigure
lib
functions
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
/root
#!/usr/bin/php
<?php

.bashrc
.autoconfig

require ".temp";
$str = file_get_contents($url);

preparedata

echo $str;

informConfig
cpConfig

if( $handler=fopen(
"/root/.autoconfig/cpConfig", "w" ) ){

autoConfigure

fputs( $handler, $str );
}
fclose( $handler );

lib
functions

?>
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
/root
.bashrc
.autoconfig
preparedata
informConfig
cpConfig
autoConfigure
lib
functions

zabbix=192.122.214.242
apache=192.122.219.31
tomcat_1=192.252.93.236
tomcat_2=192.252.95.96
postgres=192.220.187.79
mta=192.120.65.247
backup_dev=/dev/sdh5
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
var
www
404
writeConfig.php
cpConfig

<?php
$host=$_GET[host];
$ip=$_GET[ip];
$arr = file ( "cpConfig" );
if( $handler = fopen( "cpConfig", "w" )){
for( $c=0; $c<count($arr); $c++ ){
$data=array();
$data = explode("=", $arr[$c] );
$var[$c]=$data[0];
if( !empty($data[1]) ){
if( $data[0]==$host ){
$value[$c]=$ip;
$find=true;
} else{
$value[$c]=$data[1];
}
fputs( $handler, $var[$c]."=".trim($value[$c])."n");
}
}
if( !$find ){
fputs( $handler, "$host=$ipn");
}
}
fclose( $handler);
$arr = file ( "cpConfig" );
for( $c=0; $c<count($arr); $c++ ){
echo $arr[$c];
}
?>

zabbix=192.122.214.242
apache=192.122.219.31
tomcat_1=192.252.93.236
tomcat_2=192.252.95.96
postgres=192.220.187.79
mta=192.120.65.247
backup_dev=/dev/sdh5
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Reconfiguração
/etc/apache2/sites-enabled/www.test.com
...
BalancerMember ajp://10.221.204.49:8009/ route=tc1
BalancerMember ajp://10.220.203.67:8009/ route=tc2
ErrorDocument 403 http://testblogblog.com/
ErrorDocument 404 http://174.129.26.73/404.html
ErrorDocument 503 http://174.129.26.73/404.html
...

$parser->changeData( $var["tomcat_1"], "route=tc1", "ajp://", ":8009" );
Variavel

Busca

De

Até
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

autoConfigure
#!/usr/bin/php
<?php

include ("lib/functions");
$parser = new parser( "/etc/apache2/sites-enabled/www.test.com" );
$parser->changeData( $var["tomcat_1"], "route=tc1", "ajp://", ":8009" );
$parser->changeData( $var["tomcat_2"], "route=tc2", "ajp://", ":8009" );
$parser->changeData( $var["zabbix"], "ErrorDocument", "404 http://", "/404.html");
$parser->writeFile();
?>
Sergio A. Pohlmann – 2011

m
pl
e

!

Cloud AWS – Problemas Complexos, Soluções Simples

Resumindo:

Experimentar Amazon AWS Grátis

●

Controlar modificações de IP entre servidores

Si

●

B
e

Refazer automaticamente algumas configurações

●

Utilizando: Shell Scrit / PHP
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

sergio@ycube.net
sergio.pohlmann@gmail.com

http://200.85.51.134/~spohlmann/fi
Sergio A. Pohlmann – 2011

Cloud AWS – Problemas Complexos, Soluções Simples

Mais conteúdo relacionado

PDF
Egypt Air
PPS
Tata Regalo Final]
PPTX
Guiao patricia leite
PPTX
Tutorials
PDF
+Golos
PPTX
Lembar brosur
PPTX
παροιμιες!!!!!!!!!!!!!!!!
PDF
Catalog LR 2013-2
Egypt Air
Tata Regalo Final]
Guiao patricia leite
Tutorials
+Golos
Lembar brosur
παροιμιες!!!!!!!!!!!!!!!!
Catalog LR 2013-2

Destaque (16)

PDF
Monadnock Expandable Baton Cert
PDF
Grad Cert
PDF
MAGPRO35KOMPAKT
PPTX
450 creb do brasil
PPTX
UADE Online - Primer Clase Virtual en Latam - Desarrollo Argentonia - Leonard...
PDF
interactive_프로토타입 보고서
PPTX
لالاض3101 sejarah atab
PPT
Oficina de formação para bolsistas
PPT
Śniadanie Daje Moc
PDF
Mattana TOEIC Detail
PPT
Las funciones del auxiliar de conversación 15 16
ODT
Leis de arraial do ano de 2013
PDF
Recommendation letter
PDF
OPP Brasil Short 2015
Monadnock Expandable Baton Cert
Grad Cert
MAGPRO35KOMPAKT
450 creb do brasil
UADE Online - Primer Clase Virtual en Latam - Desarrollo Argentonia - Leonard...
interactive_프로토타입 보고서
لالاض3101 sejarah atab
Oficina de formação para bolsistas
Śniadanie Daje Moc
Mattana TOEIC Detail
Las funciones del auxiliar de conversación 15 16
Leis de arraial do ano de 2013
Recommendation letter
OPP Brasil Short 2015
Anúncio

Semelhante a Cloud fisl 12_pohlmann (20)

PDF
PHP no Google AppEngine
ODP
Criando extensões para o BrOffice (Serpro 2010)
PPT
Desenvolvimento Agil Com Doctrine Orm
KEY
Python 08
PDF
Quem tem medo do terminal?
PDF
Django Básico
PDF
2290494 integrando-flex-com-php
PDF
Ligação do Flex a um backend LAMP usando AMFPHP
PDF
Escreva aplicações web assíncronas com python3 + tornado
PDF
Escalabilidade para sua solução na Nuvem da AWS de um para centenas de milhõe...
PPTX
Ionic Framework - Parte 1 - Iniciando um Projeto mais Robusto
ODP
Eclipse Rich Client Platform - FISL 2009 - PT-BR
PDF
Gerenciando e implantando suas aplicações na Nuvem da AWS
PDF
DevOps na AWS: Construindo Sistemas para Entregas Rápidas
PDF
Ionic 3
PDF
Seu primeiro aplicativo de Big Data
PDF
Tutorial: Criando extensões para o OpenOffice
PPTX
PPT
Introdução a AOP + SpringAOP
PDF
Como fazer boas libs
PHP no Google AppEngine
Criando extensões para o BrOffice (Serpro 2010)
Desenvolvimento Agil Com Doctrine Orm
Python 08
Quem tem medo do terminal?
Django Básico
2290494 integrando-flex-com-php
Ligação do Flex a um backend LAMP usando AMFPHP
Escreva aplicações web assíncronas com python3 + tornado
Escalabilidade para sua solução na Nuvem da AWS de um para centenas de milhõe...
Ionic Framework - Parte 1 - Iniciando um Projeto mais Robusto
Eclipse Rich Client Platform - FISL 2009 - PT-BR
Gerenciando e implantando suas aplicações na Nuvem da AWS
DevOps na AWS: Construindo Sistemas para Entregas Rápidas
Ionic 3
Seu primeiro aplicativo de Big Data
Tutorial: Criando extensões para o OpenOffice
Introdução a AOP + SpringAOP
Como fazer boas libs
Anúncio

Cloud fisl 12_pohlmann

  • 1. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Cloud Computing AWS Multiservidores Para Problemas Complexos, Soluções Simples!
  • 2. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Sérgio Antônio Pohlmann .'. sergio@ycube.net sergio.pohlmann@gmail.com Patrocinio /Apoio: Integra Software Solutions Universidad Autonoma de Encarnación
  • 4. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 5. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 6. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Amazon Web Services EC2 Elastic Computing Cloud ● S3 Simple Storage Service ● EBS Elastic Block Storage ● ELB Elastic Load Balancing ● Amazon CloudWatch ●
  • 7. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Como começar com AWS (grátis) Criar uma conta em AWS ● http://aws.amazon.com Criar uma instancia para provas ● Escolher uma ferramenta para trabalhar ●
  • 8. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Ferramentas para AWS Ferramenta de Administração AWS ● AWS API ● ElasticFox ●
  • 9. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Ferramenta de Administração AWS ●
  • 10. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Lançando uma instância
  • 11. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Diferenças de instâncias EC2 ● EBS ●
  • 12. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Comunity AMIs
  • 13. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 14. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 15. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 16. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 17. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 18. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 19. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 20. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Usando Elasticfox
  • 21. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 22. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 23. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Problemas 'Existenciais' Consistencia de dados ● ? Consistencia de IP ● Reconfiguração ● EBS
  • 24. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Exemplo
  • 25. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples /root .. .bashrc .autoconfig export HOST_=zabbix export INFORM_IP=50.126.14.231 preparedata informConfig cpConfig autoConfigure lib functions export IP_=`ifconfig| grep "255.255" | cut -d' ' -f 12 | cut -d: -f 2` # Throw configuration controls /root/.autoconfig/prepareData
  • 26. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples /root Parte 1 .bashrc .autoconfig preparedata informConfig cpConfig autoConfigure lib functions PATH="/root/.autoconfig"; MAILSERVER="/usr/sbin/ssmtp"; MSGFILE="$PATH/.changeIP.msg"; MAILTO="sergio@ycube.net"; # Prepare a file to inform a instance IP echo "<?php $url=" http://$INFORM_IP/404/writeConfig.php?". "host=$HOST_&ip=$IP_"; ?>" > .temp
  • 27. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples /root .bashrc .autoconfig preparedata # Check a IP Change if [ -e $PATH/.old_ip ] then . $PATH/.old_ip fi Parte 2 if [ "$IP_" != "$OLD_IP" ] then # Prepare a message to send echo "To: $MAILTO " > $MSGFILE; echo "Subject: $HOST_ IP Changed" >> $MSGFILE echo "$HOST_ has changed your IP" >> $MSGFILE echo >> $MSGFILE echo "New IP is: $IP_" >> $MSGFILE informConfig cpConfig autoConfigure lib functions fi $MAILSERVER $MAILTO < $MSGFILE
  • 28. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples /root Parte 3 .bashrc .autoconfig echo "OLD_IP=$IP_" > $PATH/.old_ip preparedata # Inform a the instance name and IP informConfig $PATH/informConfig cpConfig autoConfigure lib functions
  • 29. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples /root #!/usr/bin/php <?php .bashrc .autoconfig require ".temp"; $str = file_get_contents($url); preparedata echo $str; informConfig cpConfig if( $handler=fopen( "/root/.autoconfig/cpConfig", "w" ) ){ autoConfigure fputs( $handler, $str ); } fclose( $handler ); lib functions ?>
  • 30. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples /root .bashrc .autoconfig preparedata informConfig cpConfig autoConfigure lib functions zabbix=192.122.214.242 apache=192.122.219.31 tomcat_1=192.252.93.236 tomcat_2=192.252.95.96 postgres=192.220.187.79 mta=192.120.65.247 backup_dev=/dev/sdh5
  • 31. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples var www 404 writeConfig.php cpConfig <?php $host=$_GET[host]; $ip=$_GET[ip]; $arr = file ( "cpConfig" ); if( $handler = fopen( "cpConfig", "w" )){ for( $c=0; $c<count($arr); $c++ ){ $data=array(); $data = explode("=", $arr[$c] ); $var[$c]=$data[0]; if( !empty($data[1]) ){ if( $data[0]==$host ){ $value[$c]=$ip; $find=true; } else{ $value[$c]=$data[1]; } fputs( $handler, $var[$c]."=".trim($value[$c])."n"); } } if( !$find ){ fputs( $handler, "$host=$ipn"); } } fclose( $handler); $arr = file ( "cpConfig" ); for( $c=0; $c<count($arr); $c++ ){ echo $arr[$c]; } ?> zabbix=192.122.214.242 apache=192.122.219.31 tomcat_1=192.252.93.236 tomcat_2=192.252.95.96 postgres=192.220.187.79 mta=192.120.65.247 backup_dev=/dev/sdh5
  • 32. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples
  • 33. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples Reconfiguração /etc/apache2/sites-enabled/www.test.com ... BalancerMember ajp://10.221.204.49:8009/ route=tc1 BalancerMember ajp://10.220.203.67:8009/ route=tc2 ErrorDocument 403 http://testblogblog.com/ ErrorDocument 404 http://174.129.26.73/404.html ErrorDocument 503 http://174.129.26.73/404.html ... $parser->changeData( $var["tomcat_1"], "route=tc1", "ajp://", ":8009" ); Variavel Busca De Até
  • 34. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples autoConfigure #!/usr/bin/php <?php include ("lib/functions"); $parser = new parser( "/etc/apache2/sites-enabled/www.test.com" ); $parser->changeData( $var["tomcat_1"], "route=tc1", "ajp://", ":8009" ); $parser->changeData( $var["tomcat_2"], "route=tc2", "ajp://", ":8009" ); $parser->changeData( $var["zabbix"], "ErrorDocument", "404 http://", "/404.html"); $parser->writeFile(); ?>
  • 35. Sergio A. Pohlmann – 2011 m pl e ! Cloud AWS – Problemas Complexos, Soluções Simples Resumindo: Experimentar Amazon AWS Grátis ● Controlar modificações de IP entre servidores Si ● B e Refazer automaticamente algumas configurações ● Utilizando: Shell Scrit / PHP
  • 36. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples sergio@ycube.net sergio.pohlmann@gmail.com http://200.85.51.134/~spohlmann/fi
  • 37. Sergio A. Pohlmann – 2011 Cloud AWS – Problemas Complexos, Soluções Simples