本篇內容主要講解“備份提示too many open files Errornumber 24怎么解決”,感興趣的朋友不妨來(lái)看看。本文介紹的方法操作簡(jiǎn)單快捷,實(shí)用性強。下面就讓小編來(lái)帶大家學(xué)習“mysql備份提示too many open files Errornumber 24怎么解決”吧!
一.問(wèn)題的描述
備份程序 執行前滾的時(shí)候報錯。
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:
二.問(wèn)題分析
openfiles 開(kāi)的小了。 mysql的open_file_limit受制于以下幾個(gè)參數 max_connections、 table_open_cache 、open_files_limit 以及 /etc/security/limits.conf中的配置。 max_connections和 table_open_cache 與open_files_limit 的關(guān)系: max_1 = 10 + max_connections + table_cache * 2; max_2 = max_connections * 5; max_3 = max_os_open_files;//操作系統單個(gè)進(jìn)程最大允許打開(kāi)文件句柄(文件描述符)。 open_files_limit= max( max_1, max_2 ) > max_3 ? max_3 : max ( max_1, max_2); 綜合分析發(fā)現,open_files_limit | 10240 而目前ibd表已經(jīng)10800個(gè)了。
三.解決問(wèn)題
1.my.cnf 配置 open_files_limit = 20480
重啟mysql 發(fā)現沒(méi)有變化,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.經(jīng)過(guò)前三步,重啟mysql。
重啟mysql 發(fā)現,open_files_limit | 20480。
5.修改OS用戶(hù)配置文件
經(jīng)過(guò)前四步,雖然在mysql中 看open_files_limit | 20480,但ibbackup還是在前滾時(shí)報錯。報,open_file不夠。懷疑 還是沒(méi)有生效。
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用戶(hù)配置文件
分別查看了.bash_profile 、.bashrc 、/etc/bashrc;
發(fā)現,.bash_profile調用 .bashrc ,.bashrc調用 /etc/bashrc
發(fā)現,/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 參數
之前這個(gè)參數,設置成500.這次修改到1000.
重啟mysql 解決問(wèn)題
免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。
Copyright ? 2009-2022 56dr.com. All Rights Reserved. 特網(wǎng)科技 特網(wǎng)云 版權所有 特網(wǎng)科技 粵ICP備16109289號
域名注冊服務(wù)機構:阿里云計算有限公司(萬(wàn)網(wǎng)) 域名服務(wù)機構:煙臺帝思普網(wǎng)絡(luò )科技有限公司(DNSPod) CDN服務(wù):阿里云計算有限公司 百度云 中國互聯(lián)網(wǎng)舉報中心 增值電信業(yè)務(wù)經(jīng)營(yíng)許可證B2
建議您使用Chrome、Firefox、Edge、IE10及以上版本和360等主流瀏覽器瀏覽本網(wǎng)站