SAP-C02 练习题

SAP-C02 题目讲解:灾备切换要让数据库和应用同时就绪

SAP-C02 练习题讲解。正确答案 B。答案 B。备用 ASG 的 min/max 都为零,即使 DNS 切过去也没有应用实例。

SAP-C02 免费试练题 · 考证匠讲解

题目

A company has a multi-tier web application that runs on a fleet of Amazon EC2 instances behind an Application Load Balancer (ALB). The instances are in an Auto Scaling group. The ALB and the Auto Scaling group are replicated in a backup AWS Region. The minimum value and the maximum value for the Auto Scaling group are set to zero. An Amazon RDS Multi-AZ DB instance stores the application’s data. The DB instance has a read replica in the backup Region. The application presents an endpoint to end users by using an Amazon Route 53 record. The company needs to reduce its RTO to less than 15 minutes by giving the application the ability to automatically fail over to the backup Region. The company does not have a large enough budget for an active-active strategy. What should a solutions architect recommend to meet these requirements?

A. Reconfigure the application’s Route 53 record with a latency-based routing policy that load balances traffic between the two ALBs. Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Create an Amazon CloudWatch alarm that is based on the HTTPCode_Target_5XX_Count metric for the ALB in the primary Region. Configure the CloudWatch alarm to invoke the Lambda function.
B. Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Configure Route 53 with a health check that monitors the web application and sends an Amazon Simple Notification Service (Amazon SNS) notification to the Lambda function when the health check status is unhealthy. Update the application’s Route 53 record with a failover policy that routes traffic to the ALB in the backup Region when a health check failure occurs.
C. Configure the Auto Scaling group in the backup Region to have the same values as the Auto Scaling group in the primary Region. Reconfigure the application’s Route 53 record with a latency-based routing policy that load balances traffic between the two ALBs. Remove the read replica. Replace the read replica with a standalone RDS DB instance. Configure Cross-Region Replication between the RDS DB instances by using snapshots and Amazon S3.
D. Configure an endpoint in AWS Global Accelerator with the two ALBs as equal weighted targets. Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Create an Amazon CloudWatch alarm that is based on the HTTPCode_Target_5XX_Count metric for the ALB in the primary Region. Configure the CloudWatch alarm to invoke the Lambda function.

答案

正确答案 B。答案 B。备用 ASG 的 min/max 都为零,即使 DNS 切过去也没有应用实例。

拆题

  • 备用 ASG 的 min/max 都为零,即使 DNS 切过去也没有应用实例。
  • 只读副本需要提升为可写数据库,应用配置也要指向正确端点。
  • B 把健康检查、SNS/Lambda 编排、数据库提升、ASG 扩容和 Route 53 failover 接起来。十五分钟是必须通过演练验证的 RTO 目标,不是单个服务配置后的保证。

每个选项为什么对、为什么错

  • A:延迟路由选择低延迟目标,不会自动提升数据库或把零容量 ASG 启动起来。
  • B(正确):Lambda 编排只读副本提升和 ASG 容量调整,补齐当前备用区的两个关键缺口;健康检查成功后再切流。
  • C:提前保持同等容量增加成本,且可见部分未解决数据库从只读变可写。
  • D:两 ALB 等权入口不适合当前备用区零计算容量、数据库只读的状态。仅依据主区 ALB 5xx 触发动作,也不能代替完整应用健康与受控故障切换。

放到具体场景里

教学例子:故障触发 runbook,先提升副本并确认写入,修改备用 ASG 的 max、min 和 desired capacity,等待 ALB target healthy,再让 Route 53 failover 指向备用。若只调 desired 却仍 max=0,会失败;若先切 DNS,用户会遇到无健康目标。

检查对象本例条件或动作结果与边界
数据库提升只读副本确认可写端点
计算调整 ASG 三项容量等待健康目标
入口健康后切流测量 DNS 与缓存影响

遇到同类题的判断顺序

  1. 检测故障:确认主区不可服务。
  2. 恢复数据:提升副本并校验写入。
  3. 扩起计算:调整容量并等待健康检查。
  4. 切换入口:端到端成功后导流。
结论:DNS 只能选择地址,不能把只读数据库和零实例变成可运行应用。

参考资料

继续练这门考试

同一门考试的免费试练题都附这样的完整讲解,做完再看讲解。