mysql備份提示 too many open files Errornumber 24
一.問題的描述
備份程式 執行前滾的時候報錯。
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 解決問題
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30317998/viewspace-2653929/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- nginx 報錯 accept4 () failed (24: Too many open files)NginxAI
- Too many open files in system處理
- Too many open files報錯處理
- titan-hadoop “Too many open files”修正Hadoop
- Ubuntu 解決 Too many open files 問題Ubuntu
- weblogic日誌報錯too many open filesWeb
- 解決WebLogic中Too many open files異常Web
- docker中使用systemctl命令時報Too many open files錯誤Docker
- 解決 Too many symbol filesSymbol
- Nginx報錯: "Too many open files accept" 和 "could not build the server_names_hash"NginxUIServer
- 從原始碼角度談談open_files_limit的生成邏輯及"Too many open files"的解決思路原始碼MIT
- Too many files with unapproved license異常APP
- Linux - 修改檔案控制程式碼數(Too many open files 異常)Linux
- Weblogic BEA-002616 java.io.IOException: Too many open filesWebJavaException
- 持續迴圈讀檔案,導致的too many open files如何解決
- MySQL: Too many connectionsMySql
- 超過最大檔案數—Linux-x86_64 Error: 23: Too many open files in systemLinuxError
- linux Too Many Files 問題檢視和解決方法Linux
- MySQL ERROR 1040: Too many connectionsMySqlError
- 【MySQL】Too many connections 案例一則MySql
- too many open files 與程式網路連線資料檢視[轉載自北風之神巨佬的文章]
- 關於mysql的Too many connections問題MySql
- 解決Mysql錯誤[1040]Too many connectionsMySql
- mysql的max_connections和Too many connectionsMySql
- Mysql中too many connections問題的解決MySql
- mysql報錯Changed limits: max_open_files: 5000MySqlMIT
- MySQL問題處理——1040錯誤Too many connectionsMySql
- [HP-UX] cannot fork: too many processesUX
- NETAPP - LOGIN TOO MANY USERSAPP
- when tag object too many, performance very lowObjectORM
- session_max_open_filesSession
- React報錯之Too many re-rendersReact
- nginx 修改 max open files limitsNginxMIT
- AIX5.3: Too many processes 0403-030AI
- mysql的冷備份與熱備份MySql
- Mysql備份系列MySql
- Java備份MySQLJavaMySql
- MySQL:xtrabackup備份MySql