考题解析 | 使用Amazon EC2 自动伸缩组提高应用的弹性和可扩展性


  题目

A company is migrating a distributed application to AWS. The application serves variable workloads. The legacy platform consists of a primary server that coordinates jobs across multiple compute nodes. The company wants to modernize the application with a solution that maximizes resiliency and scalability.
How should a solutions architect design the architecture to meet these requirements?
A. Configure an Amazon Simple Queue Service (Amazon SQS) queue as a destination for the jobs. Implement the compute nodes with Amazon EC2 instances that are managed in an Auto Scaling group. Configure EC2 Auto Scaling to use scheduled scaling.
B. Configure an Amazon Simple Queue Service (Amazon SQS) queue as a destination for the jobs. Implement the compute nodes with Amazon EC2 instances that are managed in an Auto Scaling group. Configure EC2 Auto Scaling based on the size of the queue.
C. Implement the primary server and the compute nodes with Amazon EC2 instances that are managed in an Auto Scaling group. Configure AWS CloudTrail as a destination for the jobs. Configure EC2 Auto Scaling based on the load on the primary server.
D. Implement the primary server and the compute nodes with Amazon EC2 instances that are managed in an Auto Scaling group. Configure Amazon EventBridge (Amazon CloudWatch Events) as a destination for the jobs. Configure EC2 Auto Scaling based on the load on the compute nodes.

  参考答案

B

  参考解析

技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。
某公司在将分布式应用程序迁移到 AWS 平台。原始平台由一个主服务器和多个计算节点组成,主服务器负责协调工作。公司希望最大化应用程序的弹性和可扩展性,以适应不断变化的工作负载。公司需要设计一个解决方案,可以有效地管理和扩展资源,同时确保系统的高可用性。

A. 不正确。配置 Amazon SQS 作为作业目的地,使用 Auto Scaling 组管理 EC2 实例作为计算节点,并基于计划进行Auto Scaling。使用Amazon SQS可以解耦作业的生产和消费,有助于提高系统的弹性和可扩展性,但是基于计划的 Auto Scaling 可能无法很好地适应不断变化的工作负载,因为它依赖于预设的缩放计划而不是实际的工作负载需求。
B. 正确。配置 Amazon SQS 作为作业目的地,使用Auto Scaling 组管理 EC2 实例作为计算节点,并根据队列大小配置 Auto Scaling 组。该方案结合了Amazon SQS的解耦能力和基于队列大小的实际需求进行自动扩展。当队列中的作业数量增加时,Auto Scaling 组会自动增加EC2实例的数量以处理更多的作业,反之亦然。这有助于确保系统能够根据需要动态调整资源,从而满足弹性和可扩展性的要求。
C. 不正确。使用 Auto Scaling 组管理包含主服务器和计算节点的 EC2 实例,将 AWS CloudTrail 作为作业目的地,并基于主服务器的负载配置Auto Scaling 组。AWS CloudTrail 主要用于记录AWS账户的活动,而不是作为作业队列。另外基于主服务器的负载进行Auto Scaling可能无法反映整体系统的负载情况,特别是当计算节点是处理实际作业的主要资源时。
D. 不正确。使用Auto Scaling组管理包含主服务器和计算节点的EC2实例,将Amazon EventBridge作为作业目的地,并基于计算节点的负载配置Auto Scaling 组。Amazon EventBridge主要用于事件路由,而不是作为作业队列。基于计算节点的负载进行Auto Scaling看似合理,但使用主服务器和固定队列(如Amazon SQS)的组合通常更为灵活和高效。