Linux – Restarting Mysql on Amazon EC2 instance

amazon ec2linuxMySQL

I have an EC2 instance in which I've installed Apache and Mysql to run a web based application. I'm experiencing slightly more demand than when the system ran with no issues.

As a result (or at least I think so), the Mysql service is having issues. A few hours ago, I was able to reboot my EC2 Instance and then start both httpd and mysqld to bring everything back up.

The problem reemerged an hour later and the same remedy doesn't help. EC2 reboots and httpd starts, but the Mysql Daemon times out on the service start and restart requests.

Has anyone experienced this problem? Or if there are any linux gurus out there, any suggestions?

Any help would be appreciated.

Some additional info – ran tail -10 /var/log/mysqld.log and got the following result:

120225 18:35:56  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
120225 18:35:56  InnoDB: Started; log sequence number 0 6422679
120225 18:35:56 [ERROR] /usr/libexec/mysqld: Error writing file '/var/run/mysqld/mysqld.pid' (Errcode: 28)
120225 18:35:56 [ERROR] Can't start server: can't create PID file: No space left on device
120225 18:35:56 mysqld_safe Number of processes running now: 0
120225 18:35:56 mysqld_safe mysqld restarted

Best Answer

There's no free space left on your /var filesystem. You'll need to delete or move some files. And I would suggest setting up some automated monitoring so that you get notified if any filesystem falls below 20% free space.