- Newest
- Most votes
- Most comments
Hello.
Are you experiencing an increase in memory or CPU usage due to the load during deployment?
For example, if sshd stops due to such a load, SSH connections will not be possible.
Therefore, please check the system log to see if any errors occurred during the time when you were unable to connect.
Also, you may be able to connect using Session Manager instead of SSH, so please check that.
https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html
Hi nag
The issue seems to be with your EC2 instance not starting properly after deployment with CodeDeploy.
Check these steps to resolve the issue:
Check Deployment Logs:
In the CodeDeploy dashboard, examine the deployment logs for any errors during startup. This might provide clues about the script issue.
Review Deployment Script:
Ensure the deployment script starts services and processes in the correct order. Verify ownership and permissions of deployed files.
Check System Logs:
Connect to the instance after a failed deployment (using a separate method if SSH fails) and check system logs (e.g., /var/log/syslog) for errors during startup.
Monitor Resource Usage:
Use the AWS CloudWatch console to monitor resource usage (CPU, memory) during deployment. If it spikes excessively, consider optimizing your deployment script or upgrading your instance type.
CodeDeploy Troubleshooting Guide: https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting.html
Amazon CloudWatch Documentation: https://docs.aws.amazon.com/cloudwatch/
=>Here's a concise summary of steps to troubleshoot why your EC2 instance becomes inaccessible after deployment with CodeDeploy:
Security Group Settings: Ensure SSH (port 22) is open in the EC2 instance's security group to your IP address or range.
=>Network ACLs: Check subnet Network ACLs to ensure they allow necessary inbound/outbound traffic.
=>Route 53 and DNS: Verify Route 53 configuration is correct and DNS settings point to the EC2 instance's IP.
=>Instance Logs: Review EC2 instance logs (/var/log/syslog, /var/log/cloud-init.log) for networking errors.
=>CodeDeploy Logs: Check CodeDeploy logs to ensure deployment scripts complete without networking issues.
=>Instance Health Checks: Monitor EC2 instance status checks in AWS Management Console for underlying issues.
=>Testing Connectivity: After deployment, test accessing the EC2 instance via public IP to rule out DNS issues.
=>Instance Type and Capacity: Consider if t2.micro instance type is sufficient during deployment phases.
=>AWS Support: If issues persist, contact AWS Support for specialized assistance.
Relevant content
- asked 3 years ago
- asked a year ago
