Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 instance shuts down by itself

EC2 Instance Type: t2.micro OS: Ubuntu 16.04.3 Config tool:Webmin

The instance has the "Instance State" as "running" but it is not really working. If I do right click -> "Instance State" -> "Stop" / "Start" then I can connect to the machine easily but after a while it goes again off.

When I try to connect I get

This site can’t be reached 18.217.7.112 refused to connect.

after a Stop -> Start of the instance everything works again.

Can anyone help me troubleshoot this? Not sure where to look and what to look for.

Thank you!

like image 619
Marius Avatar asked Jun 20 '26 19:06

Marius


1 Answers

The solution I found seems to have worked. I had another turn off, indeed, but maybe that was needed to take the new settings into account. So here is exactly what I did

  • I issued the command $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
  • My machine stopped again by itself even though in AWS it was showing "Running"
  • then I did a right click and "Reset" from AWS screen

So my guess is that issuing the command and then reboot should do the job. My machine is still up and running since Friday.

like image 69
Marius Avatar answered Jun 23 '26 12:06

Marius



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!