Health check và thay thế instance unhealthy
Việc một instance lỗi có được thay thế hay không, và vào thời điểm nào, phụ thuộc vào loại health check phát hiện lỗi và scaling activity mà Auto Scaling group đang thực hiện.
Một instance của MFTECH có dấu hiệu lỗi nhưng ASG chưa thay thế, hoặc thay thế theo thứ tự khác với dự kiến. Kết quả phụ thuộc vào loại health check phát hiện lỗi và loại hoạt động mà ASG thực hiện. Chạy từng tình huống, sau đó đổi tuỳ chọn để so sánh:
Phần cứng phía dưới i-2 gặp sự cố, status check của EC2 chuyển sang impaired. ASG dùng health check type EC2 (mặc định).
Chọn tình huống và tuỳ chọn, sau đó nhấn Chạy tình huống. Chạy lại với tuỳ chọn còn lại để so sánh.
Khi ASG chưa terminate một instance lỗi, kiểm tra lần lượt: instance còn trong health check grace period; status check đang impaired và ASG đang chờ vài phút; health check type của nhóm là EC2 nên kết quả của ELB bị bỏ qua. Tăng minimum capacity không giữ lại instance unhealthy, và Spot Instance trong nhóm cũng được thay thế khi unhealthy.
- Status check impaired: ASG chờ vài phút trước khi đánh dấu Unhealthy; instance không còn running: thay ngay.
- ELB health check chỉ có tác dụng khi bật cho ASG.
- Custom health check gọi SetInstanceHealth thì ASG thay thế instance (tôn trọng grace period theo mặc định).
- Health check replacement: terminate trước, launch sau (đổi được bằng instance maintenance policy).
- AZ rebalancing: launch trước, terminate sau.
Health checks and replacement of unhealthy instances
Whether a failing instance is replaced, and when, depends on which health check detects the failure and which scaling activity the Auto Scaling group is performing.
A MFTECH instance shows signs of failure but the ASG has not replaced it, or replaces it in a different order than expected. The outcome depends on which health check detects the failure and which kind of activity the ASG performs. Run each situation, then switch the option to compare:
Phần cứng phía dưới i-2 gặp sự cố, status check của EC2 chuyển sang impaired. ASG dùng health check type EC2 (mặc định).
Chọn tình huống và tuỳ chọn, sau đó nhấn Chạy tình huống. Chạy lại với tuỳ chọn còn lại để so sánh.
When the ASG has not terminated a failed instance, check in turn: the instance is still within its health check grace period; the status check is impaired and the ASG is waiting a few minutes; the group’s health check type is EC2, so ELB results are ignored. Raising the minimum capacity does not keep an unhealthy instance alive, and Spot Instances in the group are also replaced when unhealthy.
- Impaired status check: the ASG waits a few minutes before marking the instance Unhealthy; an instance no longer running is replaced immediately.
- ELB health checks only count when turned on for the ASG.
- A custom health check that calls SetInstanceHealth makes the ASG replace the instance (respecting the grace period by default).
- Health check replacement: terminate first, then launch (changeable with an instance maintenance policy).
- AZ rebalancing: launch first, then terminate.