基于 AWS 的 Spring Cloud 微服务实践
2020-02-27 1192浏览
- 1.AWS AWS Spring Cloud
- 2.
- 3.
- 4.
- 5.
- 6.今天我们要探讨的话题 Java/ MVN Spring Cloud ECS Docker Code* CF Terraform Cloud Native Java Micro Services Stack “ ” AWS Spring
- 7.微服务及“别人”的故事
- 8.微服务架构及挑战 Project à Product Shared Data à API or Nothing Dev and Ops à DevOps
- 9.微服务 @ Amazon Service-Oriented Architecture (SOA) Single-purpose Connect only through APIs Connect over HTTPS “Microservices”
- 10.微服务团队 - Two Pizza Teams “Service Team” Amazon.com AWS Prime ESB • Roadmap • • (You build it, you run it.) • API Evolutionary Design etc
- 11.2000年,Netflix 在物理机房里的单体架构
- 12.2016年,Netflix 在 AWS 上的微服务架构 NetflixOSS:http://netflix.github.io/https://www.infoq.com/presentations/netflix-chaos-microservices
- 13.更多的客户案例
- 14.Spring Cloud 是什么鬼?
- 15.从 Spring 到 Spring Cloudhttp://projects.spring.io/spring-cloud/http://projects.spring.io/spring-boot/http://projects.spring.io/spring-framework/
- 16.应云而生http://tech.lede.com/2017/03/15/rd/server/SpringCloud0/SpringCloudTechs.png
- 17.Spring Cloud for AWS
- 18.为云编程 - AWS 开发工具包https://aws.amazon.com/cn/sdk-for-java/
- 19.为云编程 - Spring Cloud for Amazon Web Serviceshttp://cloud.spring.io/spring-cloud-aws/spring-cloud-aws.html
- 20.Spring Cloud for AWS 帮我们优化哪些编程体验? Before 对象存储服务 After
- 21.Spring Cloud for AWS 帮我们优化哪些编程体验? EC2 虚机 虚机元数据,标 签,用户数据等 自动依赖注入 Before
- 22.Spring Cloud for AWS 帮我们优化哪些编程体验? 基于 CloudFormation 云环境部署和动态资源获取 编程是使用资源逻辑名,运 行时通过解析Stack获取CF 创建的真实资源
- 23.数据库编程优化 Automatic data source configuration and setup based on the Amazon RDS database instance. Automatic read-replica detection and configuration for Amazon RDS database instances. Retry-support to handle exception during Multi-AZ failover inside the data center. RDS
- 24.缓存编程优化 AWS ElastiCache Spring ElastiCache for memcached Spymemcached AWS Redis Spring Data Redis Jedis and Lettuce Drivers & Redis Cluster support
- 25.Spring Cloud for AWS 帮我们优化哪些编程体验? EC2Client S3Client S3 ResourceLoader AWS S3 AWS / API AWS RDS ElastiCache Spring Boot API AWS API Spring CloudFormation /
- 26.The only way to do it is do ithttps://github.com/spring-cloud-samples/aws-refapp
- 27.Spring Cloud 与微服务
- 28.Spring Cloud 对微服务的支持
- 29.AWS 平台对微服务的支持
- 30.Spring Cloud 微服务在 AWS 上如何取舍? Server Side AWS ALB & NLB Client Side Eureka & Ribbon mydomain.com Amazon Route 53 Service Auto Scaling Group Batch Tasks
- 31.Spring Cloud 微服务在 AWS 上如何取舍? Key- Value & Consul & ZK… Feature Consul Health Check zookeeper etcd ( ) keepalive heart beat Euerka Multi-DataCenter ✔ — — — KV Storage ✔ raft ca ✔ paxos cp ✔ raft cp http/grpc — Consistency cap Interface(Mult-Lang) Watch Support http dns / polling long ✔ — ap http sidecar long polling ✔ long polling/ Monitoring metrics — metrics ✔ metrics Security acl /https acl https — Spring Cloud integrationhttps://luyiisme.github.io/2017/04/22/spring-cloud-service-discovery-products/
- 32.在 AWS 上运行 Spring Cloud,如何取舍? Netflix uses Zuul for thefollowing:• • • • • • • • • • Authentication Insights Stress Testing Canary Testing Dynamic Routing Service Migration Load Shedding Security Static Response handling Active/Active traffic management ( • • Microservice 1 (Lambda) Client • API Gateway Microservice 2 (ELB+EC2) • ) • Monolith on EC2 Microservice 3 (AWS Elastic Beanstalk) • A
- 33.在 AWS 上运行 Spring Cloud,如何取舍? Spring Environment Spring Cloud Config supports storing the configuration files ineither:1. Git or Subversion 2.The local file system 3. HashiCorp Vault » Properties » Profiles Amazon S3 AWS CodeCommit Amazon EC2 EC2 Instance EC2 Instance TASK A TASK B TASK B EC2 System Manager – Parameter Store ECS Cluster EC2 UserData Parameter Store
- 34.在 AWS 上运行 Spring Cloud,如何取舍? : / Lambda Spring Cloud Hystrix S3 RDS /VPC/Subnet/Tags Elastic Load Kinesis Balancing Glacier SQS SNS SWF DynamoDB ElastiCache RedShift
- 35.在 AWS 上运行 Spring Cloud,如何取舍? Spring Cloud Sleuth & Zipkin AWS X-Ray
- 36.容器化 Spring 应用
- 37.容器化之前的典型架构 Nginx Servers Route 53 Availability Zone A Nginx Servers Internal ELB Internet ELB Nginx Servers Availability Zone B Nginx Servers
- 38.容器化之后的微服务参考架构 Amazon Route 53 ECS Cluster Amazon RDS Application Load Balancer ECS Cluster Amazon API Gateway* Amazon ECR IAM Amazon CloudWatch
- 39.Maven Plugin - 构建服务的容器镜像https://github.com/spotify/docker-maven-plugin
- 40.管理服务镜像(Push&Pull) Amazon EC2 Container Registry Docker IAM mvndocker:build-DpushImage -Dmaven.test.skip=true
- 41.运行 Spring 服务 EC2 INSTANCES LOAD BALANCER Internet TASK TASK ECS AGENT Container Container TASK TASK ECS AGENT Container Container Amazon ECS AGENT COMMUNICATION SERVICE API TASK TASK ECS AGENT LOAD BALANCER CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE Container Container Under the Hood of Amazon EC2 Container Service By Werner Vogels on 20 July 2015 06:00 AM
- 42.DevOps 流水线 ECS Reference Architecturehttps://github.com/awslabs/ecs-refarch-continuous-deployment4. Push Image 3. Build Artifact AWS CodeBuild 2. Trigger Pipeline AWS CodeCommit AWS CodePipeline Amazon ECS Spot Instance 5. Update Stack 1. Commit Code instance Amazon ECR 6. Update Service AWS CloudFormation
- 43.结束语
- 44.AWS 1,017 516 61 2010 159 2012 2014 2016 * As of 1 August 2017
- 45.AWS Spring AWS Spring 5% AWS 90% API /
- 46.Q&A
- 47.