Bảo trì instance: Standby, suspend process và health check grace period
Cơ chế tự động thay thế instance unhealthy giúp duy trì capacity, nhưng cũng có thể thay thế instance đang được bảo trì hoặc đang khởi động; cần tạm dừng cơ chế này đúng lúc.
ASG thay thế mọi instance được xác định là unhealthy. Cơ chế này phù hợp khi instance thực sự lỗi, nhưng gây vấn đề khi instance đang được vá lỗi hoặc instance mới chưa hoàn tất khởi động. Bài ELB đã trình bày việc ASG cần sử dụng ELB health check để dựa theo kết quả của load balancer; trong phần này ASG đang sử dụng ELB health check. Thử ba tác vụ bảo trì:
Chọn một tác vụ bảo trì, nhấn nút để chạy, sau đó bật tuỳ chọn và chạy lại để so sánh kết quả.
Về chi phí: MFTECH luôn cần tối thiểu 2 instance, nhiều hơn vào giờ cao điểm. Đặt minimum = 2 và mua Reserved Instances cho 2 instance chạy liên tục; phần capacity tăng thêm thanh toán theo On-Demand.
- Vá lỗi instance: chuyển sang Standby, hoặc suspend cả HealthCheck và ReplaceUnhealthy rồi resume (chỉ suspend ReplaceUnhealthy thì instance vẫn bị đánh dấu unhealthy và bị thay thế khi resume).
- Instance mới cần thời gian cài đặt ứng dụng: cấu hình health check grace period.
- ASG thay thế instance mà load balancer đánh dấu unhealthy: ELB health check.
Instance maintenance: Standby, suspended processes and health check grace period
Automatically replacing unhealthy instances keeps capacity up, but it can also replace an instance that is under maintenance or still starting up; you need a way to pause it at the right moments.
The ASG replaces every instance it determines to be unhealthy. That works when an instance has really failed, but causes problems when an instance is being patched or a new instance has not finished starting. The ELB lesson explained that the ASG needs to use ELB health checks to follow the load balancer’s results; in this part the ASG is using ELB health checks. Try three maintenance tasks:
Chọn một tác vụ bảo trì, nhấn nút để chạy, sau đó bật tuỳ chọn và chạy lại để so sánh kết quả.
On cost: MFTECH always needs at least 2 instances, more at peak hours. Set minimum = 2 and buy Reserved Instances for the 2 instances that run continuously; the extra capacity is paid On-Demand.
- Patching an instance: move it to Standby, or suspend both HealthCheck and ReplaceUnhealthy and then resume them (with only ReplaceUnhealthy suspended, the instance is still marked unhealthy and is replaced on resume).
- A new instance needs time to install the application: configure a health check grace period.
- The ASG replaces instances the load balancer marks as unhealthy: ELB health checks.