xtrabackup备份MySQL报错:InnoDB: Error number 24 means 'Too many open files'
1.使用xtrabackup备份MySQL时出现如下报错:
:: >> log scanned up to ()
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID for mysql/plugin, old maximum was
InnoDB: Operating system error number in a file operation.
InnoDB: Error number means 'Too many open files'
InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
InnoDB: File ./jira/AO_4B00E6_STASH_SETTINGS.ibd: 'open' returned OS error . Cannot continue operation
InnoDB: Cannot continue operation.
2.查看备份使用的user的ulimit
[root@linux mysql]# ulimit -a
core file size (blocks, -c)
data seg size (kbytes, -d) unlimited
scheduling priority (-e)
file size (blocks, -f) unlimited
pending signals (-i)
max locked memory (kbytes, -l)
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size ( bytes, -p)
POSIX message queues (bytes, -q)
real-time priority (-r)
stack size (kbytes, -s)
cpu time (seconds, -t) unlimited
max user processes (-u)
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
3.修改/etc/security/limits.conf
vim /etc/security/limits.conf * soft nofile * hard nofile
重新备份还是报错。
4.修改MySQL的配置文件,增加如下参数:
vim /etc/my.cnf innodb_open_files=
重新备份成功!