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以將請求發送到兩個服務器,并從正確的服務器返回每個文檔。該方案在技術上不可行,因為負載均衡器無法拆分單個請求并分別向兩個服務器發送請求以獲取文檔的不同部分。