Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro: Deploy and Manage
 {PHP, JAVA} Apps with...

Lars Wolff
November 19, 2015

Intro: Deploy and Manage
 {PHP, JAVA} Apps with
 Amazon Elastic Beanstalk

Introducing deployment of PHP and JAVA Apps with Amazon Elastic Beanstalk at AWS UserGroup Cologne (http://www.meetup.com/de/aws-cologne/events/225675562/).

Lars Wolff

November 19, 2015
Tweet

More Decks by Lars Wolff

Other Decks in Technology

Transcript

  1. #Internet!!!1 #Developer #Teams #Process #ShipIt! #Agile #Lean #PM #Certified ScrumMaster®

    #LoadTesting - Co-Founder @ StormForger.com #AWSUGCGN #WEBMONTAG #WMCGN #DevHouseFriday #Music lover #Destroy it - Rebuild it EHLO, I’m Lars Lars Wolff · @larsvegas · [email protected]
  2. –amazon web service
 (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/Welcome.html) “With Elastic Beanstalk, you can quickly

    deploy and manage applications in the AWS cloud without worrying about the infrastructure that runs those applications.”
  3. –aws in plain english
 (https://www.expeditedssl.com/aws-in-plain-english ) “Should have been called

    Amazon Platform as a Service
 
 Use this to: Move your app hosted on Heroku to AWS when it gets too expensive.
 
 It's like: Heroku, BlueMix, Modulus.”
  4. Why • (PaaS) Prototyping • (PaaS) Cloud™ • Fast &

    Awesome: Getting started in less than 2 Hrs. • PaaS but you connect to a real machine (image) • AWS eco system • (Events) • ??? less ops ??? • ??? less management ???
  5. (Back in the days) There was a project… • Classic

    LAMP Setup • Yet Another PHP Framework • Classic (dedicated) Hosting
 (Load balancer, Baremetal, VMs, DB Cluster,
 eMail-Server)
  6. (Back in the days) There was a project… BUT •

    short term app • high traffic • should scale™ out of the box • no time • no ops • no time • no ops
  7. Expecting (high) traffic? Need to make sure the app performs?

    Test your app performance,
 app-nodes limits and app scalability
 {in development, before launch}. It’s easy! Join Beta: https://stormforger.com
  8. Or*

  9. To Do • (AWS Account - obviously) • Install EB

    CLI • Your Project in a local GIT • Create EB App • Deploy http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_PHP_eb.sdlc.html
  10. Create Project <?php $data = Array( "Peter" => "Pan", "TinkerBell"

    => "TigerLily", "Jack" => "Maggie" ); http_response_code(200); header("Content-Type: application/json"); echo json_encode($data);
  11. Create EB App $ eb init Select a default region

    1) us-east-1 : US East (N. Virginia) 2) us-west-1 : US West (N. California) 3) us-west-2 : US West (Oregon) 4) eu-west-1 : EU (Ireland) 5) eu-central-1 : EU (Frankfurt) 6) ap-southeast-1 : Asia Pacific (Singapore) 7) ap-southeast-2 : Asia Pacific (Sydney) 8) ap-northeast-1 : Asia Pacific (Tokyo) 9) sa-east-1 : South America (Sao Paulo) 10) cn-north-1 : China (Beijing) (default is 3):
  12. Create EB App You have not yet set up your

    credentials or your credentials are incorrect You must provide your credentials. (aws-access-id): XXXXXXXXXXXXXXX (aws-secret-key): XXXXXXXXXXXXXXXXXXXXX
  13. Create EB App Select a platform version. 1) PHP 5.4

    2) PHP 5.5 3) PHP 5.6 4) PHP 5.3 (default is 1): 3
  14. Create EB App Do you want to set up SSH

    for your instances? (y/n): y Type a keypair name. (Default is aws-eb): hulu Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/hulu/.ssh/hulu. Your public key has been saved in /Users/hulu/.ssh/hulu.pub. The key fingerprint is: 55:c0:57:19:2a:18:f0:24:49:73:86:10:eb:7a:e4:bd hulu The key's randomart image is: +--[ RSA 2048]----+ | o+=+=.....oo | | .oB o..... | | . o o.. | | . . . | | o S | | + . | | . o . | | . . | | E | +-----------------+
  15. Deploy $ git commit -a -v [master 21f9698] deleted unused

    comment 1 file changed, 2 deletions(-) $ eb deploy Creating application version archive "21f9". Uploading aws-beanstalk-php-json-example/21f9.zip to S3. This may take a while. Upload Complete. INFO: Environment update is starting. INFO: Deploying new version to instance(s). INFO: New application version was deployed to running EC2 instances. INFO: Environment update completed successfully.
  16. SSH $ eb ssh INFO: Attempting to open port 22.

    INFO: SSH port 22 open. The authenticity of host '54.sds.sds.19 (54.sds.sds.19)' can't be established. RSA key fingerprint is ss:ss:ss:ss:ss:01:60:c7:ee:23:5d:24:62:37:a9:fe. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '54.sds.sds.19' (RSA) to the list of known hosts. _____ _ _ _ ____ _ _ _ | ____| | __ _ ___| |_(_) ___| __ ) ___ __ _ _ __ ___| |_ __ _| | | __ | _| | |/ _` / __| __| |/ __| _ \ / _ \/ _` | '_ \/ __| __/ _` | | |/ / | |___| | (_| \__ \ |_| | (__| |_) | __/ (_| | | | \__ \ || (_| | | < |_____|_|\__,_|___/\__|_|\___|____/ \___|\__,_|_| |_|___/\__\__,_|_|_|\_\ Amazon Linux AMI This EC2 instance is managed by AWS Elastic Beanstalk. Changes made via SSH WILL BE LOST if the instance is replaced by auto-scaling. For more information on customizing your Elastic Beanstalk environment, see our documentation here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html [ec2-user@ip-172-31-18-176 ~]$
  17. BRICK Commerce • Proximity Platform • iBeacons, GPS, Wifi •

    Android SDK • iOS SDK • Web Platform (Data Management + Analysis)
  18. Platform • Spring-Boot • Hosted @ AWS • 7 different

    (Micro)Services on Elastic Beanstalk • EC2 • S3, RDS, ElasticCache, DynamoDB • CloudWatch Logs
  19. Deployment • https://console.aws.amazon.com
 click. click. click. • EB CLI •

    Maven-Plugin
 (http://beanstalker.ingenieux.com.br/beanstalk-maven-plugin/)
  20. Elastic Beanstalk Extras • Multiple Environments • Configuration in Environment

    Variables • Versioning for Deployments • Rolling Deployments
  21. Lars Wolff · @larsvegas · [email protected]
 Sign up and load

    test for free: https://stormforger.com Jonathan Heinen · @marsjo_ac · [email protected]
 Learn about proximity solutions: http://brick-commerce.com Thank you!
  22. Lars Wolff · @larsvegas · [email protected]
 Sign up and load

    test for free: https://stormforger.com Jonathan Heinen · @marsjo_ac · [email protected]
 Learn about proximity solutions: http://brick-commerce.com Questions?