What You Will Learn
Intermediate
- Common EC2 issues and their causes
- A systematic debugging process
- Tools for diagnosing EC2 problems
| Problem | Likely cause | Fix |
|---|---|---|
| Cannot SSH | Security group blocks port 22 | Allow SSH (22) from your IP |
| Instance not reachable | No public IP, or wrong subnet | Check public IP, subnet, route table |
| High CPU | App using too much, or undersized instance | Check CloudWatch, upgrade instance |
| Instance terminated | Spot reclaimed, or billing issue | Check billing, use On-Demand |
Debugging process
1. Check security group (port open?). 2. Check instance state (running?). 3. Check CloudWatch metrics (CPU, network). 4. Check system log (EC2 -> Instance -> Get System Log).Practical Exercise
Launch an EC2 instance
Try SSHing with wrong security group — fail
Fix: open port 22 from your IP
SSH in and check
top for CPU usageCheck CloudWatch metrics for the instance
Key Takeaways
- Cannot SSH: check security group allows port 22.
- Not reachable: check public IP and route table.
- High CPU: check CloudWatch, upgrade instance.
- Get System Log from EC2 console for boot errors.
- Use CloudWatch for monitoring and alerting.
Comments
Comments
Post a Comment