too many files问题open_files_limit值更改无效(转)

原文http://blog.itpub.net/30127122/viewspace-2140277/
系统的值是正确的。然后修改/etc/my.cnf配置文件,添加
 
 
open_files_limit=65535
 
 
重启服务 之后 查看 show variables like '%open%'; 发现open_files_limit的值 还是1024 
  
此时我们需要修改最后一个地方
 
 
cat -n /etc/systemd/system/mysql.service
 
 
在mysql.service中添加
LimitNOFILE=65535   #新加入的内容 添加在最后一行
 
 
 
 
重启服务服务,修改了mysql.server有可能需要systemctl daemon-reload 
 
innobackupex 进行备份的时候 产生too many open files   
 
 
发现我mysql下面文件数大于10W
 
 
此时需要设置
  ulimit -n 1048576 重启后失效 所以还需要修改系统配置文件
修改系统配置文件/etc/security/limits.conf  
* soft nofile 1048576
* hard nofile 1048576
 
 
并且设置 my.cnf  open-files-limit=1048576  重启mysql服务
 
 
  
问解决题
 
 
 
 
 
 
posted @ 2018-04-03 11:02  会飞的小虫子  阅读(2117)  评论(0编辑  收藏  举报