EC2 AWS system reachability failed - amazon-ec2

The instance of my server was stopped by AWS; my instance is inaccessible now for a day.
How can I get a copy of my instance that was already stopped?
aws recommendation says terminate the instance and launch a replacement? If I terminate the instance, would I keep my data?
How can I get it to work?

Related

An EC2 instance behind a load balancer is not terminating after reboot but load balancer is going out of service

There is single EC2 instance deployed behind a ELB using Cloud Formation and now I am trying to add cron jobs to crontab by updating CF stack, however after updating the stack I rebooted the server but the changes are not reflecting on the server.
It seems like the application on the server is only rebooted not the OS of the server. When I checked status of ELB after reboot, instance state is out of service and instance state on the EC2 tab is showing running.
Note: There is no autoscaling group attached.
Check if your application on EC2 instance is listening on the port mentioned in loadbalancer.

What happens to processes when an EBS backed EC2 instance is stopped and restarted?

I'm running an application that is a web app and the backend for an ios app as well as a database in an ec2 instance. Will these processes resume if I stop, resize, and restart my instance? Will I need to go in and run startup scripts?
Any help is appreciated, I'm confused by the AWS documentation as to exactly what happens.
It's just like turning your laptop off and then back on. If you have configured the services to start automatically on boot then they will restart, if you haven't configured them to start automatically on boot then they won't.
This is a function of the software you have installed and configured on the EC2 instances, and whatever Operating System your EC2 instance is running. You won't find much about this in the AWS documentation because it isn't really Amazon specific.

not able to acces the aws ec2 instance

I am trying to access aws ec2 instance from putty and winscp but it is not getting connected to the instance. It was getting accessed previously in normal for but dont know from few days it is nt been accesible.
Please can anyone help me with its solution.
Thanks in advance
There is possibility that the aws instance may get hanged to the possible solution is to restart the aws instance. But make sure we take the backup of the current instance and restart the hanged instance and after successful restarting deleted the duplicate instance.

automatically start apache on instance launch - aws autoscaling

I have an ec2 instance serving a webpage with apache. I created an autoscaling group using an AMI of this instance in the launch config. Once CPU went over 80% and the autoscale policy ran, a new instance was created. But the CPU of my original instance continued to rise and the CPU of my new instance remained at 0%.
The new instance was not serving the web page. I am guessing this is because apache was not started with the launch of the image. I tried to ssh into the new instance to run "service httpd start" but I got the following error:
ssh: Could not resolve hostname http://ec2-xxx-xx-xxx-xxx.compute-1.amazonaws.com:
nodename nor servname provided, or not known
Why could I not ssh in? How do I configure autoscaling to automatically start apache on launch?
It would appear that you are attempting to ssh to a host with http:// in the hostname. Remove that and ssh should work.
Assuming that you created an AMI to use in AutoScaling, you would need to ensure that you chkconfig httpd on in the source instance before creating a new AMI for AutoScaling.
In order for you to connect to an EC2 instance you need two things:
The Security Group associated with your instance has an inbound rule that allows SSH communication.
Make sure you have the private key generated for the instance. Note: This is only needed if you chose to use a key in the first place.
If those two things are correct, then you can connect to your instance like this:
ssh -i "PATH_TO_YOUR_KEY.pem" ec2-user#ec2-xxx-xx-xxx-xxx.compute-1.amazonaws.com
For the other point, that is, to make sure you can start apache on launch, you can do two things:
As #atbell mentioned on a previous answer, you can make sure that the chkconfig YOUR_SERVICE on is on the AMI used to start your instance.
You can add a command as user data to your LaunchConfiguration so it runs it as soon as the instance is started:
What this will do is run start YOUR_SERVICE start as soon as the instance can respond to commands. So, whenever your AutoScaling group creates another instance, your service will surely be started. Note that the commands added to the user data field of the LaunchConfiguration are, by default, going to be executed as sudo.

Not able to login to my instance

I created an instance of ubuntu ec2 yesterday and I was trying to configure it and I stopped the serer before going home last night, when I tried log on to the same instance using ssh from my ubuntu I am getting an error which says connection timed out. I am not able to login to the instance now
If you stopped the instance, and the instance was ebs-backed then you should be able to start it using the ec2 api.
Describe the instance using the ec2-describe-instances/instance-attributes api and use ec2-run-instance start it. Once started, use the above api to retrieve the public dns name.
Using this you should be able to login to that same machine again.
if you have terminated an instance-store based virtual machine, then you can kiss it goodbye.

Resources