[awsマイスターシリーズ] aws elastic beanstalk

Download [AWSマイスターシリーズ] AWS Elastic Beanstalk

Post on 15-Jan-2015

3.808 views

Category:

Technology

0 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

  • 1. re:G eneAWS rateAWS ElasticBeanstalk 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc.

2. Agenda ! AWS Elastic Beanstalk? Elastic Beanstalk! Auto Scaling ! Advanced Tips VPC ! 2 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 3. AWS ElasticBeanstalk InstanceWARdeploy!Instance CloudWatchJavaPythonAmazon RDSElastic Load BalancerPHP.NETAuto scaling GroupRubynodeJS3 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 4. AWS Elastic BeanstalkOpsWorksCloudFormation 4 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 5. ElasticBeanstalk Application Environment URLEnvironment ConfigurationEnvironment URLEnvironment ConfigurationVersion Respository WAR/ZIP WAR/ZIP WAR/ZIPEnvironment URLEnvironment ConfigurationWAR/ZIPConfiguration Template5 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 6. ! ! SSH, AMIApplication Environment URLEnvironment ConfigurationAMI Admin AWS Management ConsoleInstanceUsersElastic Load BalancerAmazon RDSSSHInstance CloudWatchAuto Scaling GroupDeveloperWAR6 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 7. Single Instance EnvironmentURLManagement ConsoleSNSHM EC2 eclipseCloudWatchS3AutoScalingELB ElasticBeanstalk API 7 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 8. ! Application ApplicationEnvironmentVersion WAR/ZIP ! Environment URL URLXXX.elasticbeanstalk.com EC2ELB 1S38 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 9. ! Version Web S3 VersionWAR/ZIPEnvironment 9 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 10. ! /JavaPythonPHP.NETRubyJavaApache +Tomcat6, Apache+ Tomcat7.NETIIS7.5, IIS8PHPApache + mod_phpPythonApache + mod_wsgiRubyNginx + PassengerNode.jsnodeJSNginx / Apache + node.js10 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 11. ! ! IDE Eclipse Java VisualStudio .Net! AWS SDKEclipse Java, PHP, Ruby, Python, .Net ! AWS CLI$ aws elasticbeanstalk ! eb 11 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 12. eb: CLIElasticBeanstalk ! eb init ! eb start ! eb status ! eb update ! eb stop ! eb delete 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 13. eb ebinit ELB Autoscalingeb updateebstart Conguration CreatedLaunching ebdeleteReadyeb stopebdeleteUpdatingeb startTerminating , e.g.: AutoscalingNot Running ELB 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 14. Agenda ! Elastic Beanstalk? Elastic Beanstalk! Auto Scaling ! Advanced Tips VPC ! 14 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 15. ! ! ! ! ! ! ! Auto Scaling 15 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 16. 16 16 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 17. 17 17 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 18. ! Click18 18 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 19. ! 19 19 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 20. ! 2 WARZIP GitPush! S3 WAR/ZIPDeveloper 20 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 21. ZIPWAR ! 21 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 22. ZIPWAR ! IDEVisualStudioEclipse22 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 23. Git ! ElasticBeanstalkCLI URLURL http://aws.amazon.com/code/6752709412171743 Version 2.5.1$ wget https://s3.amazonaws.com/elasticbeanstalk/cli/AWS-ElasticBeanstalkCLI-2.5.1.zip $ unzip AWS-ElasticBeanstalk-CLI-2.5.1.zip23 23 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 24. Git ! $ mkdir ebapp # rails rails new ebapp $ cd ebapp $ git init! AWS Dev Tool git $ ~/AWS-ElasticBeanstalk-CLI-2.5.1/AWSDevTools/Linux/AWSDevTools-RepositorySetup.sh aws.cong24$ git aws.config AWS Access Key: AKIXXXXXXXXXXXXXXXX AWS Secret Key: zGt9B9XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX AWS Region [default to us-east-1]: ap-northeast-1 AWS Elastic Beanstalk Application: My First Elastic Beanstalk Application AWS Elastic Beanstalk Environment: Default-Environment24 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 25. Security Credentials ! IAM25 25 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 26. Security Credentials26 26 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 27. Git ! Git $ git add . $ git commit -m "initial commit"! Beanstalk $ git aws.push Counting objects: 3, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 306 bytes, done. Total 3 (delta 0), reused 0 (delta 0) remote: To https://AKIA.... * [new branch] HEAD -> master27 27 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 28. 28 Running Version 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 28 29. 1. Running VersionUpload and Deploy2. All Versions 29 29 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 30. 30 30 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 31. Application Default Environment URLEnvironment ConfigurationVersion WAR/ZIP WAR/ZIP http://Default-EnvironmentXXXXXX.elasticbeanstalk.com 31 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 32. RDS ! RDS ! RDS production: adapter: mysql2 encoding: utf8 database: username: password: host: port: InstanceAmazon RDSElastic Load Balancer Instance CloudWatchAuto scaling Group32 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 33. S3 ! S3 S3IAM Role 33 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 34. ! 34 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 35. 35 35 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 36. CPUAuto Scaling36 36 2012 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified or distributed in whole or in part without the express consent of Amazon.com, Inc. 37. Auto Scaling ! Scaling37 20