Insufficient VPS disk space causes Ngnix to fail to start

Source: Internet
Author: User
Tags mysql manual disk usage vps

VPN speed thief yesterday feel slow, visit the next blog found speed also not go, so login Control Panel glanced at. Results disk usage directly full, red is quite moving.

It's hard to think of anything that takes up so much space, a direct reboot, and then there's no, because the disk occupancy rate is still moving, and Ngnix didn't start. Try to start manually, and the error indicates that there is not enough disk space to start the Ngnix server. The saddest thing is that SSH also because of the lack of disk space is not even, really beep the puppy.

Fortunately, the VPS Control Panel with the simple shell can also be used, the input df -h View disk occupancy, the result is 100% occupancy, df -sh * and then all the way to locate the past found in the MySQL directory full (DF- h to see which directory full, and then cut to the directory after the Df-sh * to continue tracking ), the original is installed LNMP when the default opened the MySQL log, and then full of mysql-bin.* log files.

Sure enough, the/var catalogue exploded.

root@slyar:/usr/local/mysql/var# ll--BLOCK-SIZE=MB
Total 504MB
-RW-RW----1 MySQL mysql 26MB June mysql-bin.000011
-RW-RW----1 MySQL mysql 5MB June mysql-bin.000012
-RW-RW----1 MySQL mysql 27MB Aug 8 mysql-bin.000013
-RW-RW----1 mysql mysql 43MB Aug mysql-bin.000014
-RW-RW----1 mysql mysql 270MB Feb 9 17:05 mysql-bin.000020
-RW-RW----1 mysql mysql 115MB Apr 12:27 mysql-bin.000021
-RW-RW----1 mysql mysql 1MB Feb 12:07 mysql-bin.index
-RW-RW----1 mysql mysql 0MB Apr 12:34 mysql-bin.~rec~

Basically, it's all over the stuff. mysql manual found that these things are not useful, direct deletion (this operation is best done when the MySQL service is stopped, because the current log can not be used to delete, and may cause some other problems, but with Mysql>reset The Master command can empty the log directly.

root@slyar:/usr/local/mysql/var# rm-f mysql-bin.* shut down MySQL's log-bin log function directly to prevent such a situation from recurring.

VIM/ETC/MY.CNF Find:

Log-bin=mysql-bin
Binlog_format=mixed in front Plus # comment out,: Wq save exit.

At last:

/etc/init.d/mysql Restart start MySQL service, everything is OK.

Supplementary: Other questions

First, delete the Ngnix log after Ngnix can not be restarted

Fixing this problem is simple, just turn off the Ngnix log record. Find the Ngnix installation directory editor conf file, the log record that line to "Access_log/dev/null" and then try to start Ngnix, no accident Ngnix can be successfully started.

In fact, the correct steps to clear the Ngnix log should be to close the Ngnix, then the MV Rename log file, and then start Ngnix, this will automatically generate the log file, no problem can be directly deleted log files

Second, the Nginx boot occurs when the port is occupied hint problem

Fuser-n TCP 80

Take a look at what is occupied, or you can use NETSTAT-NTPL to see who occupies, and then kill off the occupied PID

Then remove the process via kill-9

Finally/etc/init.d/nginx start is OK.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.