'Aws Cloudwatch AutoScalingGroup Ec2 not working
I have been struggling several days with Auto scaling Ec2 instances. Please help....
Here are the steps:
- Create a Launch Template (nothing special here)
- Create an Auto Scaling Group by using the lauch template created in #1.
- Create an alarm in CloudWatch (When CPU Utilization > 30 in consecutive 60s, trigger action)
- Create a policy(add one unit) in autoScalingGroup created in #2. Attach the policy to the alarm.
- Lauch ec2 instance and use script to make cpu utilization > 60
Result:
- No new Ec2 instance is created when CPU utilization of existing Ec2 instance is higher than 30.
- Alarm status is always "Insufficient Data" when running the existing Ec2 instance more than 30 mins with CPU utilization higher than 30.
- Even changing the option of alerm to "Treat missing data as good (not breaching threshold)", still no new Ec2 instance is created.
Solution 1:[1]
Made some progress, Even created a new instance manually without AutoScaling, Alarm in cloudWatch not working. Not sure why. I strictly followed the instructions on an Yutube success example.
Update at 18th Feb. It's ... that Cloudwatch delayed 4 mins to send out alarm email.
- Run "stress xxx &" script at 10:30:32 (this is shown in console when running date command)
- Alarm triggered an email. Email was received with content "Friday 18 February, 2022 10:36:03 UTC"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
