Reputation: 11788
I have an Ubuntu based EC2 instance. I have tomcat installed on this instance and I did a mistake while shutting down Tomcat.
I was trying to execute shutdown.sh
present in tomcat/bin
directory but by mistake I executed OS level sudo shutdown now
command and entire EC2 instance got shutdown.
I checked into AWS console and in AWS console I can see that instance is still in Running
state but I am not able to connect to this instance through putty. It's been more than 12 hours since I accidentally shutdown that instance but AWS console is still showing it in Running
state.
I am wondering if I will lose all of my data present in that EC2 instance and how to restart such a instance?
UPDATE:
I solved the issue by just restarting the instance through AWS console. After reboot, everything started working fine and great thing is that ** I didn't lose any data **
I found this interesting thread on AWS forum in which the other guy did the same thing. Here is the URL of that thread. https://forums.aws.amazon.com/thread.jspa?threadID=70306
Hope it will someone's time some day in future :)
Thanks,
Chandrashekhar
Upvotes: 1
Views: 2013
Reputation: 3008
If the ec2 instance is not EBS backed, then shutting it down it will lose any data on the instance. EBS backed instances don't lose their instance storage when they crash or are shut down.
Instance store ec2's cannot be stopped - they can only be rebooted or terminated. Once you gave it a shutdown command, it would not be able to do anything but terminate, since it cannot go into a stopped state.
You will most likely have to terminate the instance from the console, but the AWS discussion forums may have another solution for you.
Upvotes: 2
Reputation: 384
Did you refresh the dashboard? It's probably stopped.
If it's EBS backed then you won't lose your data as long it was stored on an EBS mount. If it isn't, it's history.
Upvotes: 2