How to fix the "ERR_CONNECTION_TIMED_OUT" error for a website after stopping and starting the EC2 instance?

0

I needed to increase the storage and so stopped the EC2 instance after modifying the volume/storage.

And then, I started the instance again and could not login via SSH and got "ERR_CONNECTION_TIMED_OUT" error when accessing the website url.

Still, it's okay to connect to the instance via AWS EC2 Instance Connect. I also checked the status of Ubuntu, Apache, etc and they were working fine. (Status checks are okay as well)

As the IP addresses changed, I've also modified the related settings (Route32, IP to connect via SSH etc). And tried to ping to the new IP address and got "Request time out" error.

For the security, I've applied the same security group which worked fine with the instance before stopping.

Please let me know how I should fix the issue.

asked a year ago967 views
1 Answer
1
Accepted Answer

There's probably a couple of issues here - I suspect that as an instance reboots and becomes available, there's a short period whilst the network connection is simply unavailable.

I'm not entirely sure of your URL configuration but it might be that you're seeing issues with DNS propagation if you're updating Route53 with the new IP as the EC2 reboots. This would mean that for a short period as you access the URL, it could be pointing to the old IP address.

For the website, I'd consider placing a load balancer in front of the EC2 which will give you a consistent URL to IP mapping, but you still need to consider that if a single instance needs to be rebuilt/reboot you would have a period where the website wouldn't be available as health-checks etc. re-establish a healthy instance, so you might want to consider an auto-scaling group with two or more EC2 instances to provide high availability?

profile picture
answered a year ago
  • Thank you so much for your answer. The issue was solved after chatting with an AWS support and generating an elastic IP. The newly generated IP was banned for some reason in our country and it was solved after having an elastic IP.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions