AWS EC2 Ubuntu 14.04 Keeps Timing Out - amazon-ec2

I've spun up and setup 2 servers now in this AZ and both keep going down shortly after being used. Restarting doesn't fix it and I have to start and stop them.
By going down I mean a timeout error for apache and I can't even SSH. Port 22 is open and I can SSH in once I stop and start the EC2, it doens't run out of memory and only has 2 sites on a t2.medium with the database on RDS.
One of the sites is https://coffeehive.com.au/ if that helps
Any ideas?
Cheers,
Adrian

Related

AWS Cloud9: Environment Stops Responding

I trying to setup AWS Cloud9 and am running into a wall each time I try to setup my environments. Once I create the environment and start following this guide https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-lamp.html to configure the LAMP server, through the Cloud9 IDE terminal, the environment will just stop responding. Once I try to reload the IDE I get the follow error;
Cannot connect to instance error message.
Rebooting the instance doesn't seem to resolve the error message. But any time I make a fresh instance it will let me work from anywhere to 30 seconds to 90 seconds before it stops responding.
I have looked through my VPC port settings, as well as security group settings, and they both appear to the correct.
VPC inbound rules VPC outbound rules Security Group inbound
rules Security Group outbound rules
Additionally, I was using the default t2.micro instance until I read this post AWS Cloud9: Cannot open environment and have tried with the t2.small but I am still getting the same results.
Any help with where else to look or what else to try would be much appreciated!
Edit: It appears to be random when it stops and freezes, for example when making a m4.large instance. It froze while I was setting up the sudo mysql_secure_installation.
Once I typed "Y" it wouldn't let me press enter. Reloading the IDE gave me the VPC error.
Welcome to SO! When I use cloud9 I tend to use m4.large for anything that's non-trivial. If you're running Apache and MySQL on the same host I would definitely try the m4.large instance. It's $0.10/hr (pricing) so you could try it out fairly cheaply. I'm guessing that's the root of the issue. If you're still having the issue please repost here and we can check further.
Just to confirm:
- You can connect to the instance at least once (even if for a few seconds)
- You see the IDE and can type for 30-60 seconds before it stops responding
If you can't connect that's likely a different issue.

Amazon Linux EC2 instance unreachable - Volume Read Jumped

I'm running an Apache web server on an EC2 Amazon Linux instance. The server was unreachable (timeouts) this morning, both via SSH and through the website. I had to reboot the server and then I was able to connect via SSH, restart Apache and then I was back online. This has happened previously as well.
*CPU utilization jumped from average 2% to 10% through the downtime.
*CPU Credit balance was full the entire time
*Memory was fine the entire time.
*Volume disk read jumped up abnormally high.
What can I do to troubleshoot what was trying to read so much data from the disk?
I'd try to use lsof or iotop for starters. Later on you might want to try some monitoring tool like Zabbix or Prometheus.

AWS EC2 Instance OS repair

I have Apache server running on Centos5.4 Ec2 instance. Unfortunately while removing Bash from Centos, it also removed basic shared libraries.
Now afterward I can't SSH to that EC2 instance but Apache server is still running (I can access my site through URL).
Any idea how can I get the SSH access back? or can repair Centos Ec2 instance?
Thanks!
You can always contact the AWS support directly. They are very accommodating. send a message to them and they will recover your access, if it is doable from their end.
You may call, or you may send a message from your AWS account.

DataStax Enterprise AMI hangs during installation

I booted the DataStax AMI for Amazon EC2, logged in via SSH, but the terminal hangs on "Installation Started":
Cluster started with these options:
--clustername CassandraDev --totalnodes 1 --version enterprise --username **** --password ****
Installation started.
"Installation started" keeps going through suffixes consisting of one, two, and three dots. But nothing happens, I can't quit the installation process, and I can't access any log files to see what might be going on (or I don't know how).
Tried on two separate m3.large instances operating in a VPC subnet, at the us-east-1 region. The exact AMI is datastax_clustering_ami_2.5.1_hvm.manifest.xml (ami-ada2b6c4). On the first instance, I waited about an hour and a half. The second instance I just left online all night, with the same results.
Because this is a VPC, all outbound traffic goes through a NAT server. Security groups allow outbound traffic only on ports 80, 443, and 123. Might there be another outbound port that needs to be opened? Inbound ports do not matter, as the server is not public-facing, but within the subnet I have allowed all traffic on all ports.
Someone else has had a similar issue, but without answers so far: DataStax AMI hangs on
Any help would be appreciated!
Since there were a few tickets that came up recently around the same issue, it seems as though something recently changed within the AMI provisioning side in EC2, or this specific configuration of VPCs had never been used before, which seems a bit unlikely.
The current fix is to add an additional entry into /etc/hostname to get rid of the stderr output that occurs after each sudo command. This in turn doesn't get flagged as an error on the provisioning side.
This has been fixed and patched as documented on this ticket:
https://github.com/riptano/ComboAMI/issues/51.
If you spot any additional issues, feel free to create another ticket there.
Going forward, just launch another set of instances using the same user-data and you should be up and running.

EC2 instance stopped working after creating an Image

I'm totally new to AWS.
I managed to have an instance that runs PHPMyAdmin.
then I created an image (EBS AMI) for this instant and could not connect any more to my
phpmyadmin interface.
I know it's really stupid, but I don't know why it happens.
thanks
Make sure all needed services (e.g. ssh, Apache / nginx, MySQL) on your server get started when booting. If you create an AMI of your system AWS will shut down your server for the time the image creation takes place.
So ssh into your instance, take a look at the running processes and start the ones which you miss.
If you are taking an image from the AWS console, all services will be stopped and server will be restarted for the image to be created. However, you need to restart all the services ex: mysql, apache etc.

Resources