o2geao 发表于 2019-1-27 09:13:09

MySQL使用xtrabackup备份时报错'Too many open files'

  MySQL使用xtrabackup备份时报错:
  2015-01-29 21:28:10 7f6024ceb740InnoDB: Operating system error number 24 in a file operation.
  InnoDB: Error number 24 means 'Too many open files'.
  

  【网友提供的解决方案】:
  1)shell> ulimit -n 65535
  2)修改my.cnf配置文件的参数
  innodb_open_files = 10240
  open-files-limit = 10240
  

  【我的最终解决方案】:
  => 修改ulimit
  ulimit -n 65535
  使用 ulimit -n 65535 可即时修改,但重启后就无效了。(注ulimit -SHn 65535 等效 ulimit -n 65535,-S指soft,-H指hard)
  有如下三种修改方式:
  1.在/etc/rc.local 中增加一行 ulimit -SHn 65535
  2.在/etc/profile 中增加一行 ulimit -SHn 65535
  3.在/etc/security/limits.conf最后增加如下两行记录
  * soft nofile 65535
  * hard nofile 65535
  具体使用哪种,试试哪种有效吧,我在 CentOS中使用第1种方式无效果,使用第3种方式有效果,而在Debian中使用第2种有效果
  

  => 修改SELINUX
  以上修改后仍旧没有解决问题,最终检查了selinux,经尝试,成功解决问题!
vi /etc/selinux/config  将SELINUX=enforcing 改为 SELINUX=permissive
  




页: [1]
查看完整版本: MySQL使用xtrabackup备份时报错'Too many open files'