A company plans to run a monitoring application on an Amazon EC2 instance in a VPC. Connections are made to the EC2 instance using the instance’s private IPv4 address. A solutions architect needs to design a solution that will allow traffic to be quickly directed to a standby EC2 instance if the application fails and becomes unreachable.
Which approach will meet these requirements?
A. Deploy an Application Load Balancer configured with a listener for the private IP address and register the primary EC2 instance with the load balancer. Upon failure, de-register the instance and register the standby EC2 instance.
B. Configure a custom DHCP option set. Configure DHCP to assign the same private IP address to the standby EC2 instance when the primary EC2 instance fails.
C. Attach a secondary elastic network interface to the EC2 instance configured with the private IP address. Move the network interface to the standby EC2 instance if the primary EC2 instance becomes unreachable.
D. Associate an Elastic IP address with the network interface of the primary EC2 instance. Disassociate the Elastic IP from the primary instance upon failure and associate it with a standby EC2 instance.
C
一家公司計劃在VPC中的Amazon EC2實例上運(yùn)行一個監(jiān)控應(yīng)用程序。使用該實例的私有IPv4地址建立到EC2實例的連接。解決方案架構(gòu)師需要設(shè)計一種解決方案,以便在應(yīng)用程序出現(xiàn)故障且無法訪問時,能夠快速將流量引導(dǎo)至備用EC2實例。
哪種方法可以滿足這些要求?
公司需要在VPC中的EC2實例上運(yùn)行監(jiān)控應(yīng)用,使用私有IPv4地址連接,當(dāng)主實例應(yīng)用故障不可達(dá)時,要快速將流量導(dǎo)向備用實例,需設(shè)計滿足此要求的方案。
負(fù)載均衡服務(wù):負(fù)載均衡器通常用于在多個實例間分配流量,但一般不直接基于私有IP地址進(jìn)行配置和實例的動態(tài)注冊與注銷來實現(xiàn)故障時的快速流量切換。
DHCP服務(wù):DHCP主要用于自動分配IP地址等網(wǎng)絡(luò)配置,難以實現(xiàn)主實例故障時為備用實例分配相同私有IP地址以快速切換流量。
彈性網(wǎng)絡(luò)接口服務(wù):彈性網(wǎng)絡(luò)接口可以附加到EC2實例,并且可以配置私有IP地址。當(dāng)主實例不可達(dá)時,將配置了私有IP地址的彈性網(wǎng)絡(luò)接口移動到備用實例上,可快速實現(xiàn)流量切換。
彈性IP服務(wù):彈性IP是用于公有IP地址的,而題目中連接使用的是私有IPv4地址,所以使用彈性IP無法滿足在私有IP連接場景下快速切換流量的需求。
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
A. 不正確。部署一個配置了私有IP地址監(jiān)聽器的應(yīng)用程序負(fù)載均衡器,并將主EC2實例注冊到負(fù)載均衡器。出現(xiàn)故障時,注銷該實例并注冊備用EC2實例。應(yīng)用程序負(fù)載均衡器一般不基于私有IP地址做這種動態(tài)實例注冊注銷來實現(xiàn)故障快速流量切換,且這種方式操作相對復(fù)雜,不能快速實現(xiàn)流量導(dǎo)向備用實例。
B. 不正確。配置自定義DHCP選項集。配置DHCP以便在主EC2實例出現(xiàn)故障時為備用EC2實例分配相同的私有IP地址。DHCP自動分配IP地址,很難精準(zhǔn)實現(xiàn)主實例故障時馬上為備用實例分配相同私有IP地址,無法快速滿足流量切換需求。
C. 正確。將配置了私有IP地址的輔助彈性網(wǎng)絡(luò)接口附加到EC2實例。如果主EC2實例不可達(dá),將網(wǎng)絡(luò)接口移動到備用EC2實例。彈性網(wǎng)絡(luò)接口可配置私有IP地址,主實例不可達(dá)時移動網(wǎng)絡(luò)接口到備用實例,能快速實現(xiàn)流量切換,滿足要求。
D. 不正確。將彈性IP地址與主EC2實例的網(wǎng)絡(luò)接口關(guān)聯(lián)。出現(xiàn)故障時,從主實例解除彈性IP關(guān)聯(lián),并將其與備用EC2實例關(guān)聯(lián)。題目連接使用私有IPv4地址,彈性IP是公有IP相關(guān),此方式無法在私有IP連接場景下快速切換流量。