InnoDB: Error number 24 means ‘Too many open files’.--转载

一.问题的描述

备份程序 执行前滚的时候报错。(-apply-log)

InnoDB: Errornumber 24 means ‘Too many open files‘.

InnoDB: Some operatingsystem error numbers are described at

InnoDB: http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html

InnoDB: File name/home/nice/backup/mysql/var.20121211021656/user_db_20121123/tuser_like_core.ibd

InnoDB: File operationcall: ‘open‘.

InnoDB: Cannot continueoperation.

innobackup:Error:

二.问题分析

openfiles 开的小了。

mysql的open_file_limit受制于以下几个参数

max_connections、 table_open_cache 、open_files_limit 以及 /etc/security/limits.conf中的配置。

max_connections和 table_open_cache 与open_files_limit 的关系:

max_1 = 10 + max_connections + table_cache * 2;

max_2 = max_connections * 5;

max_3 = max_os_open_files;//操作系统单个进程最大允许打开文件句柄(文件描述符)。

open_files_limit= max( max_1, max_2 ) > max_3 ? max_3 : max ( max_1, max_2);

综合分析发现,open_files_limit  | 10240

而目前ibd表已经10800个了。

三.解决问题

1.my.cnf  配置 open_files_limit         = 20480

重启mysql 发现没有变化,open_files_limit  | 10240。

2.ulimit -a

core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 137216
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

3.vi /etc/security/limits.conf,添加

mysql            soft    nofile          8192
mysql            hard    nofile          20480

4.经过前三步,重启mysql。

重启mysql 发现,open_files_limit  | 20480。

5.修改OS用户配置文件

经过前四步,虽然在mysql中 看open_files_limit  | 20480,但ibbackup还是在前滚时报错。报,open_file不够。怀疑 还是没有生效。

ulimit -a

core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 137216
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

于是,修改OS用户配置文件

分别查看了.bash_profile 、.bashrc 、/etc/bashrc;

发现,.bash_profile调用 .bashrc ,.bashrc调用 /etc/bashrc

发现,/etc/bashrc 中有

ulimit -S -c unlimited > /dev/null 2>&1
在这一行之后 添加

ulimit -n 20480 >/dev/null 2>&1

6.重启mysql ,执行备份程序,在--apply-log,还是报错,报,open_file不够

InnoDB: Errornumber 24 means ‘Too many open files‘.

InnoDB: Some operatingsystem error numbers are described at

InnoDB: http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html

7.修改innodb_open_files 参数

之前这个参数,设置成500.这次修改到1000.

重启mysql 解决问题

四.关于Operating_System_error_codes.html

Linux System Error Codes

The following tableprovides a list of some common Linux system error codes. For a more completelist, see Linux source code.


Number


Macro


Description


1


EPERM


Operation not permitted


2


ENOENT


No such file or directory


3


ESRCH


No such process


4


EINTR


Interrupted system call


5


EIO


I/O error


6


ENXIO


No such device or address


7


E2BIG


Arg list too long


8


ENOEXEC


Exec format error


9


EBADF


Bad file number


10


ECHILD


No child processes


11


EAGAIN


Try again


12


ENOMEM


Out of memory


13


EACCES


Permission denied


14


EFAULT


Bad address


15


ENOTBLK


Block device required


16


EBUSY


Device or resource busy


17


EEXIST


File exists


18


EXDEV


Cross-device link


19


ENODEV


No such device


20


ENOTDIR


Not a directory


21


EISDIR


Is a directory


22


EINVAL


Invalid argument


23


ENFILE


File table overflow


24


EMFILE


Too many open files


25


ENOTTY


Inappropriate ioctl for device


26


ETXTBSY


Text file busy


27


EFBIG


File too large


28


ENOSPC


No space left on device


29


ESPIPE


Illegal seek


30


EROFS


Read-only file system


31


EMLINK


Too many links

声明:本文档可以随意更改,但必须署名原作者

作者:凤凰舞者 qq:578989855

时间: 2024-12-17 16:46:59

InnoDB: Error number 24 means ‘Too many open files’.--转载的相关文章

xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files'

xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files' 1.使用xtrabackup备份MySQL时出现如下报错: 190228 00:30:01 >> log scanned up to (88343615848) xtrabackup: Generating a list of tablespaces InnoDB: Allocated tablespace ID 2 for mysql/plugin,

InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法

InnoDB: Operating system error number 87 in a file operation. 错误87的解决方法 140628  8:10:48 [Note] Plugin 'FEDERATED' is disabled.140628  8:10:48 InnoDB: The InnoDB memory heap is disabled140628  8:10:48 InnoDB: Mutexes and rw_locks use Windows interlock

转 InnoDB Error Handling

14.20.4 InnoDB Error Handling Error handling in InnoDB is not always the same as specified in the SQL standard. According to the standard, any error during an SQL statement should cause rollback of that statement. InnoDB sometimes rolls back only par

InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

1,Mysqldump的时候报错如下: 2014-05-05 14:12:37 7f004a9a2700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found. 但是show tables我看这个表示存在的: 但是show create table innodb_index_stats;报错如下: mysql> show create table innodb_index_stats; ERRO

InnoDB: Error: Table "mysql"."innodb_table_stats" not found索引表没找到,主从停止

InnoDB: Error: Table "mysql"."innodb_table_stats" not found. 导致:Seconds_Behind_Master: 27360  mysql主从同步停止 stop slave; 会一直卡住,service mysqld restart后,马上又会停止同步,出现同样问题. 初步判断: 因为innodb_table_stats表丢失,导致主从同步出现问题. 解决办法: 新建innodb_index_stats/i

InnoDB: Error: io_setup() failed with EAGAIN

最近安装好了MySQL之后,在启动MySQL服务时无法正常启动MySQL.提示没有更新/var/lib/mfailedZDB.pid并退出.该MySQL与Oracle位于同一主机.有些内核参数进行过调整应该也是使用与MySQL.下面是该问题的具体描述. 1.故障现象SZDB:/usr/src/mysql_src # /etc/init.d/mysql startStarting MySQL...The server quit without updating PID file (/var/lib

InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts

在一台server中以各数据库的备份文件为数据文件启动多个MySQL实例供SQL Review使用. 之前执行一直没有问题(最多的时候有23个MySQL实例同一时候执行).后来新配置了一台server,启动其相应的实例时失败. 部分错误日志例如以下: -- 140505 16:05:59 InnoDB: Using Linux native AIO 140505 16:05:59  InnoDB: Warning: io_setup() failed with EAGAIN. Will make

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes

启动WAMP Server的时候报例如以下的错误: 140618 23:12:32 [Note] Plugin 'FEDERATED' is disabled. 140618 23:12:32 InnoDB: The InnoDB memory heap is disabled 140618 23:12:32 InnoDB: Mutexes and rw_locks use Windows interlocked functions 140618 23:12:32 InnoDB: Compres

Mongodb中经常出现的错误(汇总)child process failed, exited with error number

异常处理汇总-服 务 器 http://www.cnblogs.com/dunitian/p/4522983.html 异常处理汇总-数据库系列  http://www.cnblogs.com/dunitian/p/4522990.html 情况不唯一,这边只能当参考,大致就是这么几种解决思路 child process failed, exited with error number 1 child process failed, exited with error number 48 chi