One: Problem description
Received the message to the police, said a server MySQL is not connected.
I tried it manually, connected for more than half an hour, MySQL has not been connected, and no feedback error messages.
Error log errors:
161128 9:50:18 [ERROR] Error in Accept:too many the open files in system
161128 9:54:34 [ERROR] Error in Accept:too many the open files in system
When you switch to a MySQL user, you also report an error:
[Root@vhost_eip_8 init.d]# Su-mysql
SU:/bin/bash:too many open files Insystem
I tried to restart MySQL, and the result was a reboot failed.
[Root@vhost_eip_8 mysql]# Service Mysqldrestart
Shutting down MySQL ..... Determine
Starting mysql.the Server quit withoutupdating PID file (/[failed]ysql/vhost_eip_8.pid).
Error log errors:
161128 12:29:09 Mysqld_safe mysqld from Pidfile/data/mysql/vhost_eip_8.pid ended
161128 12:29:10 Mysqld_safe starting Mysqlddaemon with databases From/data/mysql
^g/usr/local/mysql/bin/mysqld:file './mysql-bin.index ' not Found (errcode:23)
161128 12:29:10 [ERROR] Aborting
161128 12:29:10 [Note]/usr/local/mysql/bin/mysqld:shutdown complete
The error of the newspaper is really Bishi, Mysql-bin.index document exists clearly.
I found many processes on the monitor server that connect to the server, such as:
Root 28897 28655 0 12:08? 00:00:00/usr/local/mysql/bin/mysql--host=10.0.3.47--port=3306--user=monitor--password=x xxxxxxxxx-e showdatabases;
Root 29479 29245 0 10:44? 00:00:00/usr/local/mysql/bin/mysql--host=10.0.3.47--port=3306--user=monitor--password=x xxxxxxxxx-e showdatabases;
Root 29890 29653 0 11:31? 00:00:00/usr/local/mysql/bin/mysql--host=10.0.3.47--port=3306--user=monitor--password=x xxxxxxxxx-e showdatabases;
Root 29973 29731 0 11:59? 00:00:00/usr/local/mysql/bin/mysql--host=10.0.3.47--port=3306--user=monitor--password=x xxxxxxxxx-e showdatabases;
Root 30139 29932 0 11:03? 00:00:00/usr/local/mysql/bin/mysql--host=10.0.3.47--port=3306--user=monitor--password=x xxxxxxxxx-e showdatabases;
And I have every minute of the monitoring of the scheduled task to cancel, the result is still receiving an email to the police.
Oh, my heart.
I killed all these processes on the monitor server:
Ps-ef | grep MySQL | grep-v grep |cut-c 9-15 |xargs kill-9
Then suddenly received more than 10 alarm mail, I was drunk, this is a flash flood outbreak? :
After a few seconds, no more to receive the alarm mail. Two: The cause of the error
The Fs.file-max value setting is too small.
This value can be viewed in this way:
Cat/proc/sys/fs/file-max
Found the result was 65536.
III: Solutions
Modify the value Fs.file-max in the/etc/sysctl.conf to 6553600
Then execute the SYSCTL-P
At this point, and then restart MySQL, it started successfully.
--The main reference of this article: Https://zhidao.baidu.com/question/179045384319146284.html,
Http://blog.sina.com.cn/s/blog_8da9c942010116vn.html