考题解析 | 使用 Amazon EFS 为多个应用提供文件访问


  题目

A company is hosting a web application on AWS using a single Amazon EC2 instance that stores user-uploaded documents in an Amazon EBS volume. For better scalability and availability, the company duplicated the architecture and created a second EC2 instance and EBS volume in another Availability Zone, placing both behind an Application Load Balancer. After completing this change, users reported that, each time they refreshed the website, they could see one subset of their documents or the other, but never all of the documents at the same time.
What should a solutions architect propose to ensure users see all of their documents at once?
A. Copy the data so both EBS volumes contain all the documents
B. Configure the Application Load Balancer to direct a user to the server with the documents
C. Copy the data from both EBS volumes to Amazon EFS. Modify the application to save new documents to Amazon EFS
D. Configure the Application Load Balancer to send the request to both servers. Return each document from the correct server

  参考答案

C

  参考解析

技巧:排除明显错误选项,在没有明显错误的选项中选择最合理的选项。
某公司原本在AWS上使用单个 Amazon EC2 实例和一个 Amazon EBS卷来托管其 web 应用程序和用户上传的文档。为了提高可扩展性和可用性,公司复制了这个架构,在另一个可用区创建了第二个 EC2 实例和 EBS 卷,并将它们放置在一个 Application Load Balancer(应用负载均衡器)后面。然而,这样做之后,用户报告说每次刷新网站时,他们只能看到一部分文档,而不是所有文档。

A. 不正确。复制数据以使两个 EC2 实例上的 EBS 卷都包含所有文档。该解决方案虽然可以确保两个实例都保持所有文档,但需要手动或自动地同步数据,这有可能会导致数据不一致,并且增加了管理的复杂性。此外,这种方法并没有解决根本的架构问题,即多个实例如何共享和访问相同的文档数据。
B. 不正确。配置 Application Load Balancer 以将用户定向到包含文档的服务器。这种方法不可行,因为负载均衡器的目的是分散流量,而不是基于文件存储的位置来路由请求。
C. 正确。将数据从两个 EBS 卷复制到 Amazon EFS。修改应用程序以将新文档保存到 Amazon EFS。Amazon Elastic File System (EFS) 是一种为云环境设计的可扩展文件系统,它允许在多个AWS实例之间共享文件存储。通过将数据迁移到 EFS,可以确保所有实例都能访问相同的文件,从而解决用户只能看到部分文档的问题。此外,修改应用程序以将新文档保存到 EFS,可以确保数据的一致性和可访问性。
D. 不正确。配置Application Load Balancer以将请求发送到两个服务器,并从正确的服务器返回每个文档。该方案在技术上不可行,因为负载均衡器无法拆分单个请求并分别向两个服务器发送请求以获取文档的不同部分。